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

John Hubbard <jhubbard at nvidia dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jhubbard at nvidia dot com

--- Comment #3 from John Hubbard <jhubbard at nvidia dot com> ---
Here are some data points in favor of adding this warning:

1) It's already desirable in a real project (Linux kernel, as Matthew pointed
out), and

2) Clang has already gone there, presumably for good reasons as well.

3) Anecdote: as an experienced C programmer, I can tell you that the "b(-x)"
results are rarely what a programmer would want, nor intend. (Of course, the
ideal is a perfect type-safe match between input and args, but that doesn't
always happen in real code.)

The compiler knows enough to significantly help here, by warning. It's also
possible to update the -Wsign-conversion documentation to match, if necessary,
let's not forget that.

Reply via email to