This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53431] New: C++ preprocessor ignores #pragma GCC diagnostic ignored "-Wundef"
- From: "ml.lattuada at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 21 May 2012 06:21:03 +0000
- Subject: [Bug c++/53431] New: C++ preprocessor ignores #pragma GCC diagnostic ignored "-Wundef"
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
Bug #: 53431
Summary: C++ preprocessor ignores #pragma GCC diagnostic
ignored "-Wundef"
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: ml.lattuada@libero.it
The following code:
#pragma GCC diagnostic ignored "-Wundef"
#if FOO
#endif
int main (void) { return 42; }
compiled with
g++ -o test test.c -Wundef -Werror
gives:
test.c:2:5: error: "FOO" is not defined [-Werror=undef]
cc1plus: all warnings being treated as errors
On the contrary
gcc -o test test.c -Wundef -Werror
does not give any error
gcc version is
gcc (Debian 4.7.0-8) 4.7.0