public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "markus at oberhumer dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug preprocessor/64698] New: preprocessor ignores #pragma GCC diagnostic when using -save-temps
Date: Tue, 20 Jan 2015 20:07:00 -0000	[thread overview]
Message-ID: <bug-64698-4@http.gcc.gnu.org/bugzilla/> (raw)

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.


             reply	other threads:[~2015-01-20 20:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20 20:07 markus at oberhumer dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-64698-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).