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.
*/
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;
*/
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];