macros: "do-while" versus "({ })" and a compile-time error

From: Robert P. J. Day
Date: Mon Jan 08 2007 - 13:58:06 EST



just to stir the pot a bit regarding the discussion of the two
different ways to define macros, i've just noticed that the "({ })"
notation is not universally acceptable. i've seen examples where
using that notation causes gcc to produce:

error: braced-group within expression allowed only inside a function

i wasn't aware that there were limits on this notation. can someone
clarify this? under what circumstances *can't* you use that notation?
thanks.

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