http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54365

--- Comment #8 from Florian Weimer <fweimer at redhat dot com> 2012-08-30 
13:56:04 UTC ---
(In reply to comment #7)
> This is not surprising, just use integer arithmetic instead of pointer
> arithmetic.  Pointer arithmetic not only has undefined wrapping, it is defined
> only within the bounds of the object it points into (or one past the last byte
> in it, but you can't dereference it in that case).

I was hoping that -fwrapv would turn pointer arithmetic into pure address
arithmetic as well.  The -fwrapv documentation only mentions integer arithmetic
so this is not a bug, it's just ... surprising.

Reply via email to