[Swan-dev] cannot compile libreswan 3.28: error: missing initializer for field ?isag_reserved? of ?struct isakmp_generic?

Paul Wouters paul at nohats.ca
Fri May 24 17:46:08 UTC 2019


On Fri, 24 May 2019, D. Hugh Redelmeier wrote:

> Subject: Re: [Swan-dev] cannot compile libreswan 3.28: error: missing
>     initializer for field ?isag_reserved? of ?struct isakmp_generic?
> 
> | From: António Silva <asilva at wirelessmundi.com>
>
> | /home/packages/src/libreswan/libreswan-3.28/programs/pluto/ikev2_message.c
> | /home/packages/src/libreswan/libreswan-3.28/programs/pluto/ikev2_message.c: In
> | function ‘ikev2_reassemble_fragments’:
> | /home/packages/src/libreswan/libreswan-3.28/programs/pluto/ikev2_message.c:749:2:
> | error: missing initializer for field ‘isag_reserved’ of ‘struct
> | isakmp_generic’ [-Werror=missing-field-initializers]
>
> We don't explicitly enable this warning flag.  I grepped through our
> tree and the only hits on this string are of the form:
>
> 	werror-no-missing-field-initializers
>
> which I don't actually understand and appears only in
> mk/docker-targets.mk.
>
> I don't think that we want to enable such a warning: being able to
> write initializers with missing fields has a well-defined meaning in
> C, and certainly code that I've written exploits this.
>
> In this particular example, isag_reserved is a reserved field; it
> should be initialized to zero; the C standard says that this will
> happen implicitly.

I would prefer we compile on more compilers/settings, and we do
initialize all items. Although I thought this was only an issue for
us on really old compilers (like RHEL6/CentOS6)

Paul


More information about the Swan-dev mailing list