Re: Comments on File of the Week: debug.c

2007-05-16 Thread Andy Armstrong
On 16 May 2007, at 15:14, Klaas-Jan Stol wrote: Actually, I was taught when learning Java, and assumed (yes, I know) it might have been the case for C. Anyway, please don't forget the other comments :-) This one was trivial ;-) Well - just so you know - it's as wrong for Java as it is for

Re: Comments on File of the Week: debug.c

2007-05-16 Thread Andy Armstrong
On 16 May 2007, at 15:20, Andy Armstrong wrote: More pedantically bitwise & and | are guaranteed to evaluate both arguments. And as you say they don't constitute a sequence point[1] so the order of evaluation of the arguments is undefined. [1] http://en.wikipedia.org/wiki/Sequence_point -

Re: Comments on File of the Week: debug.c

2007-05-16 Thread Andrew Dougherty
On Wed, 16 May 2007, Klaas-Jan Stol wrote: > hi, > I've been studying the code in the fotw: debug.c and below are my comments, > if they're of any interest. Feel free to neglect, I'm kinda picky. > > 1. >while (*command && (isalnum((int) *command) || *command == ',' || >*command == ']

Re: Comments on File of the Week: debug.c

2007-05-16 Thread Andy Armstrong
On 16 May 2007, at 15:11, jerry gay wrote: it's bitwise AND where order isn't guaranteed--i'm pretty sure that's the point of confusion. More pedantically bitwise & and | are guaranteed to evaluate both arguments. Logical && and || are guaranteed to short circuit completely reliably. -- An

Re: Comments on File of the Week: debug.c

2007-05-16 Thread jerry gay
On 5/16/07, Andrew Dougherty <[EMAIL PROTECTED]> wrote: On Wed, 16 May 2007, Klaas-Jan Stol wrote: > hi, > I've been studying the code in the fotw: debug.c and below are my comments, > if they're of any interest. Feel free to neglect, I'm kinda picky. > > 1. >while (*command && (isalnum((int

Re: Comments on File of the Week: debug.c

2007-05-16 Thread Klaas-Jan Stol
On 5/16/07, jerry gay <[EMAIL PROTECTED]> wrote: On 5/16/07, Andrew Dougherty <[EMAIL PROTECTED]> wrote: > On Wed, 16 May 2007, Klaas-Jan Stol wrote: > > > hi, > > I've been studying the code in the fotw: debug.c and below are my comments, > > if they're of any interest. Feel free to neglect, I'

Comments on File of the Week: debug.c

2007-05-16 Thread Klaas-Jan Stol
hi, I've been studying the code in the fotw: debug.c and below are my comments, if they're of any interest. Feel free to neglect, I'm kinda picky. 1. while (*command && (isalnum((int) *command) || *command == ',' || *command == ']')) I'm not 100% sure, but: I've always been taught that