https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82063

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-08-31
                 CC|                            |manu at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Jim Wilson from comment #0)
> Noticed this while looking at the -Wall documentation.
> 
> -Walloc-alloc-size-larger-than= is listed in the c-family/c.opt file as
> being enabled by -Wall, however, nothing is provided for the enable/disable
> values, as is done for every other -Wall enabled options that takes an
> argument.  The code tries to enable it using the default value of 1 and a
> NULL string, but since the option takes a string argument, the 1 value is
> ignored, and the NULL string is used, so it gets set to zero, which disables
> it.  I stepped through cc1 code in the debugger to verify this.  If we
> really do want this enabled by -Wall, then we probably need an extension to
> LangEnabledBy to specify on/off strings for arguments that take strings.

This is already possible:
https://gcc.gnu.org/onlinedocs/gccint/Option-properties.html

LangEnabledBy(language, opt)
LangEnabledBy(language, opt, posarg, negarg)

    When compiling for the given language, the option is set to the value of
-opt, if not explicitly set. opt can be also a list of || separated options. In
the second form, if opt is used in the positive form then posarg is considered
to be passed to the option, and if opt is used in the negative form then negarg
is considered to be passed to the option. It is possible to specify several
different languages. Each language must have been declared by an earlier
Language record. See Option file format.

See examples in c.opt.

Reply via email to