<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64357>64357</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang 16 -> 17 migration path for -pedantic -Wno-gnu-empty-initializer
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
porglezomp
</td>
</tr>
</table>
<pre>
We have a user building with `-pedantic` who has `-Wno-gnu-empty-initializer` set on their codebase.
Preflighting Clang 17 adoption, their code is failing because `-Wno-gnu-empty-initializer` no longer exists.
That's now covered under `-Wno-c2x-extensions` but this doesn't suppress that warning on Clang 16.
You can't use both flags, because `-Wno-gnu-empty-intializer` is no longer a flag in Clang 17, which means there is no combination of flags that lets you suppress this warning across adjacent clang versions.
Can we re-add this warning flag to leave a migration path that lets them continue to build with two adjacent clang versions?
Reproducer to check against:
```c
struct Example {
int x;
};
int main(void) {
struct Example example = {};
}
```
- Clang 16: `-Werror -pedantic -Wno-gnu-empty-intializer` - OK
- Clang 17: `-Werror -pedantic -Wno-c2x-extensions` - OK
- Clang 16: `-Werror -pedantic -Wno-c2x-extensions` - does not suppress the diagnostic, fails with `-Wgnu-empty-intializer`.
- Clang 17: `-Werror -pedantic -Wno-gnu-empty-intializer` - fails with `-Wunknown-warning-option`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2P4jgT_jXmUgpKHCCdQw4zzXB5D-9qtVJrjxW7iD3j2JE_gJ5fv3JCMww73aOVUCCJ6_koqh4MQQ-WqGPbz2y7X2GKyvlucn4w9N2N06p38rV7IVB4IkBIgTz0SRup7QBnHRWwXVlMJNFGLdiuhLNyoDDMz1-sKwabChqn-Fpoq6NGo7-TzwcDRXAWoiLtQThJPQZas3LPyk9_eDoaPaiYaZ4N2gGqBlC6KWpnGX--KwMd4Ija5KM9CUyBfk9uHRhnB_JAFx1iuPL-pTAy3gSw7gzCnciThGQl-Ruk4JeCLpFs0M6GjNWnCFHpANJRsIw3EUKaJk8hQFQY4YzeZnXOvnnZXfn-dgkELjVZd--igqPBIWSPH7m5N6PDnR-c60HfuJoMdVZaKBgJbdZEnq5Fwo29tpi7Cu64UC-iDcUAry7de9Hh5gWFdyEAyq8oyEYQM9mJ_NyWq71ntHAm8FSglD_XzyKjA0PLZI168IuMCaO6kxAVjSCcjdomyhXz-C2zF8_uPQWsPiwaluufNHknkyCfIYQi8Q1wQG1DZPX1DNuVy0cs9yH6JCJ8ueA4GQLWfF6eg7YRLqy-3rJm_-P3fM3vR9SW8aeT05Lx9q4YAB6A6Y2g3s_n7vGa_YO2e57iNk6s_rRMCXnvPNwWEj6cmwL-_78HpOZjpH8P_y8wfqPmVxh5c8C6nxaHQGocrAs5WPjzvOPhR-a8vONq_d8cvd-bR75kv1l3tsV1gotrFu3Klexq2dYtrqirdm1VVmW75SvVlX27qQXftFW9rVrkfbvZbp92m6pp5fEoxUp3vOR1-VRyXlXbLV-XAkVfNY2g5ljzTcs2JY2ozdqY07h2fljpEBJ1u029bVYGezJhDm_OLZ1hfsk4z1nuu1xT9GkIbFOaOeRuKFFHQ93b_wUFq7_kgH1YwuPH7boF6ip506kYp5B3iR8YPww6qtSvhRsZP2Ta61cxefeVRGT8MIsNjB9mM_8EAAD___BXIl0">