On Thu, Jan 05, 2023 at 06:01:37AM -0700, Theo de Raadt wrote: > Florian Obser <flor...@openbsd.org> wrote: > > > On 2023-01-05 11:09 +01, Theo Buehler <t...@theobuehler.org> wrote: > > > On Thu, Jan 05, 2023 at 11:03:04AM +0100, Claudio Jeker wrote: > > >> gcc4 does not really support C99 initalizers. It works most of the time > > >> but fails for more complex structs. Just fall back to memset() here. > > > > > > deraadt used { {0} } in kr_send_dependon(). Apparently that works. > > > I really don't understand why we can't use a 24 years old standard. > > > > We ran into an c99 issue in nsd and upstream was quite adamant that they > > want to keep using c99 stuff. Turned out gcc4 does not support all of > > c99 by default so they did some autoconf magic that sprinkled -std=c99 > > into the compiler invocation when needed. This also worked on gcc3 > > archs. Which apparently also fully supports c99 if you ask it nicely. > > Maybe our old gcc should be flag-tweaked internally to always have that > on. Are there any downsides?
The warning is not silenced by -std=c99: cc -O2 -pipe -std=c99 -Wall -I/usr/src/usr.sbin/bgpd -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -Werror-implicit-function-declaration -MD -MP -c /usr/src/usr.sbin/bgpd/kroute.c /usr/src/usr.sbin/bgpd/kroute.c: In function 'knexthop_true_nexthop': /usr/src/usr.sbin/bgpd/kroute.c:2162: warning: missing braces around initializer /usr/src/usr.sbin/bgpd/kroute.c:2162: warning: (near initialization for 'gateway.ba') Also I thought that gcc4 defaults to -std=c99 or gnu99. -- :wq Claudio