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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic, easyhack
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-06-11
                 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 chrysn from comment #0)
> which indicates that no special-purpose warning exists for the behavior. it
> has been suggested by redi on irc that a `-Wbinary-constants` should be
> introduced (along with other specific labels like imaginary-constants) to
> combat this, and that the relevant code is around libcpp/expr.c:697.

You may do this or you may simply use cpp_pedwarning_with_line (pfile,
CPP_W_PEDANTIC,...). 

Every warning that is conditional on an option should use the appropriate
CPP_W_* flag corresponding to that option. Thus, every warning that is
conditional on CPP_PEDANTIC (pfile) should use CPP_W_PEDANTIC. 

The guidelines available here https://gcc.gnu.org/wiki/DiagnosticsGuidelines
for pedwarn/OPT_Wpedantic also apply to libcpp, but using
cpp_pedwarning/CPP_W_PEDANTIC. In particular, you may use cpp_pedwarning
without CPP_W_PEDANTIC, but you may not use CPP_W_PEDANTIC without
cpp_pedwarning and you may not use CPP_PEDANTIC (pfile) without CPP_W_PEDANTIC.

I see many cases in libcpp that do not follow these rules and they are likely
suffering from the same problem.

Reply via email to