https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107952
--- Comment #8 from Siddhesh Poyarekar <siddhesh at gcc dot gnu.org> --- (In reply to qinzhao from comment #7) > (In reply to Richard Biener from comment #1) > > GCC considered this as a flex-array. > > do you mean for the following example: > > typedef struct { > char pad; > char data[]; > } F2; > > typedef struct { > unsigned pad; > F2 flex; > } S2; > > although C standard disallow the above, GCC extension treats S2.flex.data as > a flex-array? > > How about: > > typedef struct { > char pad; > char data[]; > } F2; > > typedef struct { > F2 flex; > unsigned pad; > } S2; > > do we have any documentation on this Gcc extension? There's an open bug to document these semantics: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77650