[Bug c/66773] sign-compare warning for == and != are pretty useless
daniel.marjamaki at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Jul 6 18:23:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66773
--- Comment #2 from Daniel Marjamäki <daniel.marjamaki at gmail dot com> ---
Thanks!
Hmm.. in my humble opinion, when I see the code:
int f(void) { return 0xffffffff == -1; }
.. I get the impression that the developer probably wants to test if the
bitpattern 0xfff.. matches -1.
I'd say an arbitrary U32 variable will rarelly have such large values unless
it's representing bitpatterns.. indexes, positions, sizes, etc are not that
large. and if you match a bitpattern against a negative value I'd say the match
is probably expected.
Is it possible to test how much noise this generates? My feeling is that if I
run this on various open source projects I will get lots of pure noise. If I am
right, do you think such noise would be convincing?
More information about the Gcc-bugs
mailing list