This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/28022] New: Incorrect pedwarn for , expression in #if in c99 mode
- From: "sabre at nondot dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Jun 2006 06:44:14 -0000
- Subject: [Bug preprocessor/28022] New: Incorrect pedwarn for , expression in #if in c99 mode
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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