From: Etienne Dechamps Date: Sun, 7 Jan 2018 14:48:08 +0000 (+0000) Subject: Fix "use of GNU empty initializer extension" warning. X-Git-Tag: release-1.1pre16~33 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=43cf631bc10097448db041639ad07f84f647017e;p=tinc Fix "use of GNU empty initializer extension" warning. --- diff --git a/src/ifconfig.c b/src/ifconfig.c index f4b84537..3723c97a 100644 --- a/src/ifconfig.c +++ b/src/ifconfig.c @@ -86,7 +86,7 @@ bool ifconfig_footer(FILE *out) { static subnet_t ipv4, ipv6; void ifconfig_address(FILE *out, const char *value) { - subnet_t address = {}; + subnet_t address = {NULL}; char address_str[MAXNETSTR]; if(!str2net(&address, value) || !net2str(address_str, sizeof(address_str), &address)) { @@ -168,7 +168,7 @@ void ifconfig_address(FILE *out, const char *value) { } void ifconfig_route(FILE *out, const char *value) { - subnet_t subnet = {}, gateway = {}; + subnet_t subnet = {NULL}, gateway = {NULL}; char subnet_str[MAXNETSTR] = "", gateway_str[MAXNETSTR] = ""; char *sep = strchr(value, ' '); diff --git a/src/linux/device.c b/src/linux/device.c index 54ea5dca..2c40ead0 100644 --- a/src/linux/device.c +++ b/src/linux/device.c @@ -117,7 +117,7 @@ static bool setup_device(void) { logger(DEBUG_ALWAYS, LOG_INFO, "%s is a %s", device, device_info); if(ifr.ifr_flags & IFF_TAP) { - struct ifreq ifr_mac = {}; + struct ifreq ifr_mac = {{{0}}}; if(!ioctl(device_fd, SIOCGIFHWADDR, &ifr_mac)) { memcpy(mymac.x, ifr_mac.ifr_hwaddr.sa_data, ETH_ALEN); diff --git a/src/net_packet.c b/src/net_packet.c index 9c913cab..c8f48d32 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -878,7 +878,7 @@ bool send_sptps_data(node_t *to, node_t *from, int type, const void *data, size_ if(relay_supported) { if(direct) { /* Inform the recipient that this packet was sent directly. */ - node_id_t nullid = {}; + node_id_t nullid = {{0}}; memcpy(buf_ptr, &nullid, sizeof(nullid)); buf_ptr += sizeof(nullid); } else { @@ -1579,7 +1579,7 @@ static node_t *try_harder(const sockaddr_t *from, const vpn_packet_t *pkt) { static void handle_incoming_vpn_packet(listen_socket_t *ls, vpn_packet_t *pkt, sockaddr_t *addr) { char *hostname; - node_id_t nullid = {}; + node_id_t nullid = {{0}}; node_t *from, *to; bool direct = false;