[cfe-dev] Premature macro expansion in preprocessor?
andyg1001 at hotmail.co.uk
Fri Nov 9 15:06:29 PST 2012
On Friday, November 09, 2012 11:48 PM, Chandler Carruth wrote:
> Personally, I also find it distasteful that the feature tests are
> treated as normal function-style-macros, as I don't think it is
> reasonable to use your LP and RP macros above ...
Yes, its only use, I think, is in some obfuscated coding contest!
> I wonder if it would make more sense to define the feature tests
> as special tokens in the preprocessor much like defined().
Actually, I differ in opinion here. I think it is useful that they
are implemented as function-style-macros because this means they
can be used in contexts outside of #if directives. defined() is
limited in its usefulness by this.
More information about the cfe-dev