Adjust how gcc4 handles the "missing braces around initializer" warning.
authorclaudio <claudio@openbsd.org>
Wed, 18 Jan 2023 10:27:05 +0000 (10:27 +0000)
committerclaudio <claudio@openbsd.org>
Wed, 18 Jan 2023 10:27:05 +0000 (10:27 +0000)
commit64bcbf86c1fc4a7f6e466ead4c062cac4f7775b8
treea71c64ee84e7336970550fb4963431bbffbe1a78
parent7b8866bb540f59d8ca6b1f14820ead992608364a
Adjust how gcc4 handles the "missing braces around initializer" warning.

In c99 any value can be initalised using a { 0 } constructor independent
of the type. Now if a struct's first member is another struct then gcc4
issues the above warning but it should not do that.

Move the warning check from push_init_level() to pop_init_level() and
check if either { 0 } or { } was used. If additional implicit braces
were added surpress the warning.

Inspired by gcc PR#64709
OK deraadt@ miod@
gnu/gcc/gcc/c-typeck.c