From b79ea15c3dcc872452405b021bce7d196a7115dc Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 11 Jun 2017 12:13:22 +0200 Subject: [PATCH] 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. --- net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]; -- 2.39.5