[PATCH RESEND] size reduction and coding style for who.c

Wolfgang Denk wd at denx.de
Sun Mar 12 06:10:32 PST 2006


In message <200603121133.55131.yann.morin.1998 at anciens.enib.fr> you wrote:
> 
> Because the statement in the if might be a macro, and thus you wouldn't get
> the expected behavior. Consider the following code extract:

Only if your expectations are wrong...

> #define foo(x) if(x) {   \
>                    blah; \
>                } else {  \
>                    bar;  \
>                }
> 
> if (cond)
>     foo(i);
> 
> To which 'if' does the 'else' refer to, when the macro has been expanded by the
> preprocessor?

This is unequivocally defined by the C standard.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"If the code and  the  comments  disagree,  then  both  are  probably
wrong."                                                - Norm Schryer


More information about the busybox mailing list