[Bug middle-end/93582] [10 Regression] -Warray-bounds gives error: array subscript 0 is outside array bounds of struct E[1]
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Feb 4 20:25:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93582
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
It seems like the reporter might be conflating the forming of a past-the-end
pointer (what the GRABEXT macro does) with dereferencing that pointer (the use
of the -> operator with the result).
This would be valid:
void *p = GRABEXT (&e);
The test case in comment #0 is not because it accesses the object at that
address (past the end of e).
More information about the Gcc-bugs
mailing list