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

D. Hugh Redelmeier hugh at mimosa.com
Fri May 24 17:18:03 UTC 2019

| 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:


which I don't actually understand and appears only in

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.

More information about the Swan-dev mailing list