This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/51391] Differences between setting Winline in command-line and through pragma GCC diagnostic
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 03 Dec 2011 10:59:21 +0000
- Subject: [Bug c/51391] Differences between setting Winline in command-line and through pragma GCC diagnostic
- Auto-submitted: auto-generated
- References: <bug-51391-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51391
Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 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Ãpez-IbÃÃez <manu at gcc dot gnu.org> 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 defaults.
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 expect
anyone else to fix this anytime soon).