This testcase:
#if 1 , 0
#endif
Should not warn with -std=c99 -pedantic. It currently does due to an inverted
conditional. This (cpplib/expr.c:1376):
default: /* case CPP_COMMA: */
if (CPP_PEDANTIC (pfile) && (!CPP_OPTION (pfile, c99)
|| !pfile->state.skip_eval))
cpp_error (pfile, CPP_DL_PEDWARN,
"comma operator in operand of #if");
should be:
if (CPP_PEDANTIC (pfile) && !(CPP_OPTION (pfile, c99)
|| pfile->state.skip_eval))
-Chris
--
Summary: Incorrect pedwarn for , expression in #if in c99 mode
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sabre at nondot dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28022