[Swan-dev] CentOS6/Jessie error: missing braces around initializer

Antony Antony antony at phenome.org
Fri Jun 21 12:30:26 UTC 2019


/home/build/libreswan/testing/ipcheck/ip_endpoint_check.c: In function 'check_sockaddr_as_endpoint':
/home/build/libreswan/testing/ipcheck/ip_endpoint_check.c:103:3: error: missing braces around initializer [-Werror=missing-braces]
   } sa = {0};
   ^
/home/build/libreswan/testing/ipcheck/ip_endpoint_check.c:103:3: error: (near initialization for 'sa.sa') [-Werror=missing-braces]
cc1: all warnings being treated as errors
../../mk/depend.mk:34: recipe for target 'ip_endpoint_check.o' failed

https://travis-ci.org/antonyantony/libreswan/builds/548633001

above lines are from from Debain Jessie. I noticed Debian error message is a 
bit more descriptive than CentOS 6.

Googling point to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
No easy solutions there.

My fix would be 
diff --git a/testing/ipcheck/ip_endpoint_check.c b/testing/ipcheck/ip_endpoint_check.c 
-               } sa = {0};
+               } sa;
+               zero(&sa); 

any one violently against this fix? or has better fix?

I feel we used have more zero(&sa);. Now we are using more authentic C code 
and running into issues:)

Isn't zero(&sa); still correct? 

I will try to read up why not on Fedora. If any one know quick answer please 
share.

CentOS 7 message
https://travis-ci.org/antonyantony/libreswan/builds/548632709

CentOS 6 
https://travis-ci.org/antonyantony/libreswan/builds/548632642

-antony

PS: I am guessing you can see the travis? Or is it only if you login?


More information about the Swan-dev mailing list