[Bug c++/68816] gcc fails to detect pointer overflow leading to undefined behaviour

2015-12-09 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68816 --- Comment #6 from David Binderman --- (In reply to Martin Sebor from comment #5) > GCC warns for this case with -O2 -Wstrict-overflow=3 so I think this bug can > be closed as invalid. I tried out the flag you suggest and it generated lots of f

[Bug c++/68816] gcc fails to detect pointer overflow leading to undefined behaviour

2015-12-09 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68816 Martin Sebor changed: What|Removed |Added Status|NEW |RESOLVED Last reconfirmed|2015-12-09 00

[Bug c++/68816] gcc fails to detect pointer overflow leading to undefined behaviour

2015-12-09 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68816 --- Comment #4 from Jonathan Wakely --- (In reply to David Binderman from comment #2) > (In reply to Jonathan Wakely from comment #1) > > there is no overflow in your example to detect, > > AFAIK, the if statement can only be true if overflow oc

[Bug c++/68816] gcc fails to detect pointer overflow leading to undefined behaviour

2015-12-09 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68816 Manuel López-Ibáñez changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug c++/68816] gcc fails to detect pointer overflow leading to undefined behaviour

2015-12-09 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68816 --- Comment #2 from David Binderman --- (In reply to Jonathan Wakely from comment #1) > there is no overflow in your example to detect, AFAIK, the if statement can only be true if overflow occurs. > I assume you're asking for the anti-pattern t

[Bug c++/68816] gcc fails to detect pointer overflow leading to undefined behaviour

2015-12-09 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68816 --- Comment #1 from Jonathan Wakely --- 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