https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119350
Bug ID: 119350
Summary: flexible array initialization is allowed when
initialized with `{}` with C23
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Take:
```
struct f {
int t;
int tt[];
};
struct f b = {1, {}};
```
This is should be rejected with -pedantic-errors since initializing flexible
array is an extension. If we change `{}` to `{1}` then we reject it correct.
clang rejects it in both cases.
I think this is the same cause as PR 65673 and might be solved by the same way
as suggested by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65673#c3.
Especially since the comment is not correct for C23:
/* Silently discard empty initializations. The parser will
already have pedwarned for empty brackets. */