GCC turns &~ into | due to undefined bit-shift without warning
Vincent Lefevre
vincent+gcc@vinc17.org
Wed Mar 13 02:25:00 GMT 2019
On 2019-03-12 21:56:59 +0100, David Brown wrote:
> I disagree. To generate an unconditional error (rejecting the program), the
> compiler would need such proof - such as by tracing execution from main().
> But to generate a warning activated specifically by the user, there is no
> such requirement. It's fine to give a warning based on the code written,
> rather than on code that the compiler knows without doubt will be executed.
There's already a bug about spurious warnings on shift counts:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
More information about the Gcc
mailing list