https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106333
--- Comment #6 from Eran Kornblau ---
Indeed!
/tmp/x.c:18:44: runtime error: signed integer overflow: 9223372036854775807 -
-1 cannot be represented in type 'long long int'
Thanks!
Eran
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106333
--- Comment #5 from Andrew Pinski ---
There was -Wstrict-overflow but many of those warnings are gone in recent
versions of the compiler and it was way too noisy. -fsanitize=undefined should
be able to detect the problem at runtime instead.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106333
--- Comment #4 from Eran Kornblau ---
Ok, thank you both.
One last point - maybe it makes sense to at least output a warning in this
case?
I added '-Wall -pedantic -Wextra' to the command, and didn't get any warning
about this.
The end result
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106333
--- Comment #3 from Jonathan Wakely ---
(In reply to Eran Kornblau from comment #2)
> Thanks Andreas, I understand there's an overflow here, but isn't it a bug
> that it affects the second part of the condition?
No.
> I mean, any value is le
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106333
--- Comment #2 from Eran Kornblau ---
Thanks Andreas, I understand there's an overflow here, but isn't it a bug that
it affects the second part of the condition?
I mean, any value is legit for the first part of the condition, if the behavior
is
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106333
Andreas Schwab changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---