This is the mail archive of the gcc-patches@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]

[PATCH opt*.awk/middle-end] Detect wrong arguments to EnabledBy


The argument to EnabledBy() must be one or more options with the
Common flag, otherwise the setting is silently ignored. This patch
detects this case when generating the options.c file and gives an
appropriate error. There were two options suffering from this: -Wchkp
is fixed by using LangEnabledBy instead, but -Wnull-dereference cannot
be enabled by -Wall or -Wextra because it triggers false positives
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16351#c35)

Bootstrapped and regression tested on x86_64-linux-gnu.

OK?

gcc/ChangeLog:

2015-08-08  Manuel LÃpez-IbÃÃez  <manu@gcc.gnu.org>

    * doc/invoke.texi (Wnull-dereference): Move after Wnonnull.
    Not enabled by -Wall.
    * optc-gen.awk: Give nicer error messages. Detect if the argument
    of EnabledBy is not a Common option.
    * common.opt (Wnull-dereference): Not enabled by -Wall.
    * opt-functions.awk (lang_enabled_by): Nicer error messages.

gcc/c-family/ChangeLog:

2015-08-08  Manuel LÃpez-IbÃÃez  <manu@gcc.gnu.org>

    * c.opt (Wchkp): Use LangEnabledBy instead of EnabledBy.

Attachment: fix-wrong-enabled-by.diff
Description: Text document


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