[Bug middle-end/78174] out of bounds array subscript in rtl.h NOTE_DATA macro

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Oct 31 23:41:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78174

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think the warning is not called for and here is why.  There is no way in both
C89 and C++ (in C99 there is) to say the array at the end of a struct (even
inside an union) is a variable length.  So GCC decided that any array at the
end of a structure (even inside an union or another stucture) can be considered
a variable length array.

See https://gcc.gnu.org/onlinedocs/gcc-6.2.0/gcc/Zero-Length.html .


More information about the Gcc-bugs mailing list