[Bug driver/79659] Provide valid values for integer options (e.g. -Wformat) with --help= option

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Mar 14 22:27:00 GMT 2017


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-03-14
                 CC|                            |manu at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #1)
> because we generate assert for optimization options:
> 
>   gcc_assert (IN_RANGE (opts->x_flag_lifetime_dse, -128, 127));
> 
> I'm wondering whether cutting values out of possible range to maximum (or
> minimum) would be desired?

Even that range is too large for an option that only takes 0,1,2

It should simply emit an error that the value passed is not within the allowed
values. Allowed values should be encoded in the .opt files.


More information about the Gcc-bugs mailing list