[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <45A3CC15.1030005@zytor.com>
Date: Tue, 09 Jan 2007 09:08:37 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: "Robert P. J. Day" <rpjday@...dspring.com>
CC: Linux kernel mailing list <linux-kernel@...r.kernel.org>
Subject: Re: macros: "do-while" versus "({ })" and a compile-time error
Robert P. J. Day wrote:
> 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.
>
Well, you can apparently not use it as a part of a constant expression
(which makes sense; do-while is illegal there too.) That would be the
only case in which an expression is permitted outside a function at all.
-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists