From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 483 invoked by alias); 20 Jan 2015 20:07:49 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 465 invoked by uid 48); 20 Jan 2015 20:07:45 -0000 From: "markus at oberhumer dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: markus at oberhumer dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg02110.txt.bz2 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.