public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/64698] New: preprocessor ignores #pragma GCC diagnostic when using -save-temps
@ 2015-01-20 20:07 markus at oberhumer dot com
  2015-01-20 22:40 ` [Bug preprocessor/64698] " manu at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: markus at oberhumer dot com @ 2015-01-20 20:07 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-17 18:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-20 20:07 [Bug preprocessor/64698] New: preprocessor ignores #pragma GCC diagnostic when using -save-temps markus at oberhumer dot com
2015-01-20 22:40 ` [Bug preprocessor/64698] " manu at gcc dot gnu.org
2021-05-27 13:15 ` markus at oberhumer dot com
2022-06-17 18:57 ` lhyatt at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).