Poul-Henning Kamp <[EMAIL PROTECTED]> types:
> Ahh, but here you hit one of my pet-peeves.  I hate assignments inside
> conditionals.  I prefer the above written as:
> Anyway, if you want it spelled out the way I would want it:
> 
> 0. No assignments in if()
> 
> 1. In conditions, pointers should be explicitly compared against NULL:
> 
>       if (foo == NULL)
> or
>       if (foo != NULL)
> 
> 2. In conditions, non-interger numeric types should be explicitly compared
>    to zero
> 
>       if (float_t == 0.0)
> 
> 3. Integers need not be explicitly compared to zero:
> 
>       if (foo & MASK)
> not
>       if ((foo & MASK) != 0)

I would like it spelled out. Since style(9) uses assignments in
conditionals in it's examples, rule 0 probably won't fly. Rule 1 and 2
are redundant.

Looking at the text in the page on -stable, I think the one-word
change from boolean to "integer" would remove the ambiguity.

        Thank you,
        <mike
 --
Mike Meyer <[EMAIL PROTECTED]>                      http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to