This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/51391] Differences between setting Winline in command-line and through pragma GCC diagnostic


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).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]