I see constructions like:
#ifdef FOO || defined BAR
...
#endif
and compiler's complaints "warning: extra tokens at end of #ifdef directive", obviously it should be:
#if defined FOO || defined BAR
...
#endif
Does the standard explicitly say so? Could you point at the relevant part?
In C99, 6.10 Preprocessing directives, paragraph 1 is Syntax:
if-group:
# if constant-expression new-line groupopt
# ifdef identifier new-line groupopt
# ifndef identifier new-line groupopt
It shows your first construction with #ifdef
is incorrect as only an identifier can follow the #ifdef
, a constant expression is not allowed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With