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

--- Comment #2 from Ella Ma <alansnape3058 at gmail dot com> ---
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.

Reply via email to