From c236dc161dbab21ebfddc633c939c5b38459816e Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 8 Feb 2019 12:37:08 +0100 Subject: [PATCH] device: avoid "-Wmissing-braces" warning for initializing "struct in6_addr" The right way is IN6_ADDR_INIT_ANY. While at it, don't initialize multiple variables in the same line. ../src/devices/nm-device-ip-tunnel.c:153:29: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] struct in6_addr local6 = { 0 }, remote6 = { 0 }; ^ {} --- src/devices/nm-device-ip-tunnel.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/devices/nm-device-ip-tunnel.c b/src/devices/nm-device-ip-tunnel.c index ca5f9c3f5d..1dc2bc964b 100644 --- a/src/devices/nm-device-ip-tunnel.c +++ b/src/devices/nm-device-ip-tunnel.c @@ -149,9 +149,13 @@ update_properties_from_ifindex (NMDevice *device, int ifindex) NMDeviceIPTunnel *self = NM_DEVICE_IP_TUNNEL (device); NMDeviceIPTunnelPrivate *priv = NM_DEVICE_IP_TUNNEL_GET_PRIVATE (self); int parent_ifindex = 0; - in_addr_t local4 = 0, remote4 = 0; - struct in6_addr local6 = { 0 }, remote6 = { 0 }; - guint8 ttl = 0, tos = 0, encap_limit = 0; + in_addr_t local4 = 0; + in_addr_t remote4 = 0; + struct in6_addr local6 = IN6ADDR_ANY_INIT; + struct in6_addr remote6 = IN6ADDR_ANY_INIT; + guint8 ttl = 0; + guint8 tos = 0; + guint8 encap_limit = 0; gboolean pmtud = FALSE; guint32 flow_label = 0; NMIPTunnelFlags flags = NM_IP_TUNNEL_FLAG_NONE;