[Bug c/77650] struct with a nested flexible array followed by another member accepted

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Sep 20 14:08:00 GMT 2016


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

--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
Documenting the semantics of this extension would work, though to be usable
safely, GCC would also need to change to recognize that the nested flexible
array member aliases the subsequent members and treat the two sets as if they
were declared in a union.  My own preference, however, would be to reject such
constructs in user code.  As long as changing Glibc to use a zero-length array
is feasible (those would continue to be accepted in this context), it should be
possible to do.


More information about the Gcc-bugs mailing list