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

Yann E. MORIN yann.morin.1998 at anciens.enib.fr
Sun Mar 12 10:33:55 UTC 2006


Hello all!

On Saturday 11 March 2006 192, Rob Landley wrote:
> Changing spaces to tabs is cool.  Why the extra curly brackets around single 
> line ifs?  (I haven't rejected this one, I'm just asking if there's a 
> rationale here.  Seems an aesthetic choice.)

Because the statement in the if might be a macro, and thus you wouldn't get
the expected behavior. Consider the following code extract:

----8<----
#define foo(x) if(x) {   \
                   blah; \
               } else {  \
                   bar;  \
               }

if (cond)
    foo(i);
----8<----

To which 'if' does the 'else' refer to, when the macro has been expanded by the
preprocessor?

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |   ^                |
| --==< °_° >==-- °---.----------------:  X  AGAINST      |  /e\  There is no  |
| web: ymorin.free.fr | SETI at home 3808 | / \ HTML MAIL    |  """  conspiracy.  |
°---------------------°----------------°------------------°--------------------°



More information about the busybox mailing list