https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120354
--- Comment #3 from qinzhao at gcc dot gnu.org --- (In reply to Ella Ma from comment #2) > Sorry, I made a mistake when making the example. > This problem happens when the flex-array member is not the last, **and the > members below it are in a record type**. (GCC will report if they are in > integer types) > > Which means, in the original example, the `y` elements in `union X` and > `union Y` should be in a struct or union (it is also not reported even if > the struct or union is empty), rather than `int`. > > Details and comparison with Clang in https://godbolt.org/z/zjPY9z5E7, please > ignore the previous link to godbolt. Yes, I can repeat this issue.