This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/64698] New: preprocessor ignores #pragma GCC diagnostic when using -save-temps
- From: "markus at oberhumer dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 20 Jan 2015 20:07:43 +0000
- Subject: [Bug preprocessor/64698] New: preprocessor ignores #pragma GCC diagnostic when using -save-temps
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64698
Bug ID: 64698
Summary: preprocessor ignores #pragma GCC diagnostic when using
-save-temps
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
Assignee: unassigned at gcc dot gnu.org
Reporter: markus at oberhumer dot com
This could be related to bug 53431, though this report is about C and not C++.
Actually I had thought that "-save-temps" just dumps the internal state, but
that does not seem to be true.
The following code:
#pragma GCC diagnostic ignored "-Wundef"
#if FOO
#endif
int main (void) { return 42; }
compiled with
gcc-4.9 -Wundef -Werror -save-temps -c bug_wundef.c
gives:
bug_wundef.c:2:5: error: "FOO" is not defined [-Werror=undef]
#if FOO
^
cc1: all warnings being treated as errors
On the contrary
gcc-4.9 -Wundef -Werror -c bug_wundef.c
does not give any error.