coding style for who.c

Rob Landley rob at
Mon Mar 13 19:05:22 UTC 2006

On Monday 13 March 2006 1:54 pm, Robin Farine wrote:
> On Sunday March 12 2006 06:24, Rob Landley wrote:
> > If one of them is a constant, it emits no warning.
> Indeed. I could not reproduce any gcc warning with 'if (a & b)', 'a'
> and 'b' being constants or variables. Must be due to a mistake
> while picking mushrooms.

It might have produced a warning on older versions.

if (a & b) doesn't work quite like if (a && b), but it's not the obvious error 
that if (a = b) tends to be.  If you restrict yourself to logic values rather 
than arbitrary numbers, and don't mind losing the short circuit behavior, 
then something if (a==b & c==d) will in fact work as expected.

> Robin

Never bet against the cheap plastic solution.

More information about the busybox mailing list