Nevertheless,  I (and others seem to agree) would like to name that
    particular warning, so it can be enabled/disabled. Also, there is a
    similar warning for unsigned >= 0 and unsigned < 0 in -Wextra. There
    are bug reports about the inconsistency (http://gcc.gnu.org/PR23587).
    So, it would be nice to unify them, give them a name and properly
    document the new option.

I agree it would be a useful feature to be able to enable and disable
this warning (and various others) for the whole compilation.
That future would be a way to prevent these spurious and expected warnings.

However, this is not the best solution, because it would also suppress
any other warnings of the same kind that might occur unexpectedly in
other code in Emacs.  Those warnings might indicate real bugs.

The ideal solution to this would be a construct we can use to turn off
warnings in a small piece of the code.  We could use it to turn off
these warnings in FIXNUM_OVERFLOW_P, and the warning would still be
enabled for the rest of the Emacs source code.

In Emacs Lisp, there is a feature called `with-no-warnings'.  If you
write `(with-no-warnings ...)' around an expression, it suppresses all
compiler warnings from that expression.  You use it around small
expressions that you know will produce warnings which do not indicate
anything is wrong.

It would be nice to have such a construct in GNU C, something that
could be used in a macro expansion, and would turn off _all_ warnings
for the code within the construct.

This feature could use _Pragma, or __attributes__.

Reply via email to