Re: do {} while(0)

Alexander Viro (viro@math.psu.edu)
Mon, 28 Jun 1999 05:13:36 -0400 (EDT)


On Mon, 28 Jun 1999, wu_yb wrote:

> There are many
> do {} while(0)
> do { ... } while(0)
> in kernel source.
> Any difference between {} and do {} while(0); or
^
Notice the absence of ; in definition. It's an old trick.
#define X {}
is bad since if (foo) X; else bar(); will be screwed. do-while eats a
semicolon.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/