https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109565
Eric Gallager changed:
What|Removed |Added
CC||egallager at gcc dot gnu.org
--- Commen
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109565
--- Comment #6 from Andrew Pinski ---
Yes it should mention overflow on pointers.
Anyways also see
https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fwrapv-pointer
and right below that with fstrict-overflow .
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109565
--- Comment #5 from Frank Heckenbach ---
> Agreed, but you asked for it with that option.
Nope, I asked for warnings about signed integer overflow.
> So you shouldn't have to care about begin(c) < end(c) either, it has to be
> true. But you as
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109565
--- Comment #4 from Jonathan Wakely ---
(In reply to Frank Heckenbach from comment #2)
> Maybe technically correct, but not useful to the user.
Agreed, but you asked for it with that option.
> The user's code doesn't involve pointers at all. I
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109565
Richard Biener changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Last reconfirmed|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109565
--- Comment #2 from Frank Heckenbach ---
Maybe technically correct, but not useful to the user.
The user's code doesn't involve pointers at all. It makes two queries about a
span object. As the user, I don't even (and shouldn't have to) care wh
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109565
--- Comment #1 from Andrew Pinski ---
I suspect the warning is correct.
In this case it is p < p + size where size is known to be 2 because of the
previous condition.
So there is an assumption for pointer overflow not to happen for p+2.