https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86259
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
--- Comment #8 from Martin Sebor <msebor at gcc dot gnu.org> ---
The code in comment #0 is undefined. It's not valid to advance a pointer to A
to point to B and dereference the pointer. It doesn't matter if the pointer
points to the outermost object or to one of its subobjects. This is true for
hand-rolled loops as much as for functions like strlen that take strings as
arguments. Likewise, the test case in comment #5 is undefined for the same
reason (a char array of size one can only hold the empty string).