[Bug c++/90885] GCC should warn about 2^16 and 2^32 and 2^64

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jun 14 11:36:00 GMT 2019


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

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
There's nothing wrong about implicit fallthrough, misleading indentation,
ambiguous else, or missing parentheses in nested logic expressions either. But
people get it wrong all the time.

I can't see a good reason to write 2^16 when you mean 18, or 10^9 when you mean
3, so it's probably a bug. And there's an easy workaround to avoid the warning:
just write the exact constant as a literal, not an XOR expression.


More information about the Gcc-bugs mailing list