From: Andre Noll Date: Sun, 11 Jun 2017 10:13:22 +0000 (+0200) Subject: net.c: Silence clang warning. X-Git-Tag: v0.6.1~72 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=b79ea15c3dcc872452405b021bce7d196a7115dc;p=paraslash.git net.c: Silence clang warning. clang-3.8.0 on FreeBSD complains about a recent change to net.c: net.c:606:33: warning: missing field 'ss_family' initializer [-Wmissing-field-initializers] struct sockaddr_storage ss = {0}; ^ This line was introduced in commit 63128eea (net: Always initialize struct sockaddr_storage) to avoid a warning from the static analyzer of clang. Setting .ss_family initializes all struct members, which makes both the analyzer and the compiler happy again. --- diff --git a/net.c b/net.c index 6c23fdd9..50243673 100644 --- a/net.c +++ b/net.c @@ -603,7 +603,7 @@ static inline int estimated_header_overhead(const int af_type) */ int generic_max_transport_msg_size(int sockfd) { - struct sockaddr_storage ss = {0}; + struct sockaddr_storage ss = {.ss_family = 0}; socklen_t sslen = sizeof(ss); int af_type = AF_INET; @@ -629,7 +629,7 @@ int generic_max_transport_msg_size(int sockfd) */ char *remote_name(int fd) { - struct sockaddr_storage ss = {0}; + struct sockaddr_storage ss = {.ss_family = 0}; const struct sockaddr *sa; socklen_t sslen = sizeof(ss); char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];