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
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
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68816
Manuel López-Ibáñez changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Last reconfirmed|
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
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