From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13116 invoked by alias); 3 Dec 2011 11:00:12 -0000 Received: (qmail 13103 invoked by uid 22791); 3 Dec 2011 11:00:10 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 03 Dec 2011 10:59:24 +0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/51391] Differences between setting Winline in command-line and through pragma GCC diagnostic Date: Sat, 03 Dec 2011 11:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Last reconfirmed CC Component Summary Ever Confirmed Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 X-SW-Source: 2011-12/txt/msg00227.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D51391 Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2011-12-03 CC| |manu at gcc dot gnu.org Component|preprocessor |c Summary|pragma GCC diag ignored |Differences between setting |then warning of Winline |Winline in command-line and |activates -fno-inline |through pragma GCC | |diagnostic Ever Confirmed|0 |1 --- Comment #13 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez 2011-12-03 10:59:21 UTC --- As Andrew explained, this is because the pragma uses handle_option, but command-line options go through a different code path that sets those defau= lts.=20 I am pretty sure there are many more cases of this. The short-term fix is to duplicate that logic also in common_handle_option in a new case for OPT_Winline. The long term fix is to encode the dependencies in .opt files = and let the awk scripts to generate the necessary code to handle all cases. But= my awk skills are not so good. The fix is probably a one-line change, plus testcase and changelog (but of course, one needs to build gcc and regression test the patches, so don't ex= pect anyone else to fix this anytime soon).