[Bug middle-end/93582] [10 Regression] -Warray-bounds gives error: array subscript 0 is outside array bounds of struct E[1]
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Feb 4 20:00:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93582
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
This is about us not accepting the code anymore, I think it's what libXt relies
on. Quoting Adam J.:
"Where GRABEXT here is just doing the standard C trick for incrementing
past the current struct and returning a (differently typed) pointer to
the data beyond:
#define GRABEXT(p) ((XtServerGrabExtPtr)((p)+1))"
I'm not sure if we want to break this though the code certainly look dubious.
clang currently accepts it.
More information about the Gcc-bugs
mailing list