[Bug c++/68816] gcc fails to detect pointer overflow leading to undefined behaviour
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Dec 9 15:21:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68816
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Since GCC isn't a static analyzer, and there is no overflow in your example to
detect, it's unsurprising (to me) that there's no diagnostic.
I assume you're asking for the anti-pattern to be recognized and a "condition
is always false" warning issued, rather than silently assuming the condition is
always true and removing the check?
More information about the Gcc-bugs
mailing list