netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/1] net/ipv6/route.c: work around gcc-4.4.4 anon union initializer issue
@ 2018-01-13  0:18 akpm
  2018-01-15 19:28 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2018-01-13  0:18 UTC (permalink / raw)
  To: davem, netdev, akpm, dsahern, idosch

From: Andrew Morton <akpm@linux-foundation.org>
Subject: net/ipv6/route.c: work around gcc-4.4.4 anon union initializer issue

gcc-4.4.4 has problems with initializers of anonymous union fields.

net/ipv6/route.c: In function 'rt6_sync_up':
net/ipv6/route.c:3586: error: unknown field 'nh_flags' specified in initializer
net/ipv6/route.c:3586: warning: missing braces around initializer
net/ipv6/route.c:3586: warning: (near initialization for 'arg.<anonymous>')
net/ipv6/route.c: In function 'rt6_sync_down_dev':
net/ipv6/route.c:3695: error: unknown field 'event' specified in initializer
net/ipv6/route.c:3695: warning: missing braces around initializer
net/ipv6/route.c:3695: warning: (near initialization for 'arg.<anonymous>')

Fixes: 2127d95aef6c ("ipv6: Clear nexthop flags upon netdev up")
Cc: Ido Schimmel <idosch@mellanox.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 net/ipv6/route.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN net/ipv6/route.c~net-ipv6-routec-work-around-gcc-444-anon-union-initializer-issue net/ipv6/route.c
--- a/net/ipv6/route.c~net-ipv6-routec-work-around-gcc-444-anon-union-initializer-issue
+++ a/net/ipv6/route.c
@@ -3583,7 +3583,7 @@ void rt6_sync_up(struct net_device *dev,
 {
 	struct arg_netdev_event arg = {
 		.dev = dev,
-		.nh_flags = nh_flags,
+		{ .nh_flags = nh_flags, },
 	};
 
 	if (nh_flags & RTNH_F_DEAD && netif_carrier_ok(dev))
@@ -3692,7 +3692,7 @@ void rt6_sync_down_dev(struct net_device
 {
 	struct arg_netdev_event arg = {
 		.dev = dev,
-		.event = event,
+		{ .event = event, },
 	};
 
 	fib6_clean_all(dev_net(dev), fib6_ifdown, &arg);
_

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch 1/1] net/ipv6/route.c: work around gcc-4.4.4 anon union initializer issue
  2018-01-13  0:18 [patch 1/1] net/ipv6/route.c: work around gcc-4.4.4 anon union initializer issue akpm
@ 2018-01-15 19:28 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-01-15 19:28 UTC (permalink / raw)
  To: akpm; +Cc: netdev, dsahern, idosch

From: akpm@linux-foundation.org
Date: Fri, 12 Jan 2018 16:18:27 -0800

> From: Andrew Morton <akpm@linux-foundation.org>
> Subject: net/ipv6/route.c: work around gcc-4.4.4 anon union initializer issue
> 
> gcc-4.4.4 has problems with initializers of anonymous union fields.
> 
> net/ipv6/route.c: In function 'rt6_sync_up':
> net/ipv6/route.c:3586: error: unknown field 'nh_flags' specified in initializer
> net/ipv6/route.c:3586: warning: missing braces around initializer
> net/ipv6/route.c:3586: warning: (near initialization for 'arg.<anonymous>')
> net/ipv6/route.c: In function 'rt6_sync_down_dev':
> net/ipv6/route.c:3695: error: unknown field 'event' specified in initializer
> net/ipv6/route.c:3695: warning: missing braces around initializer
> net/ipv6/route.c:3695: warning: (near initialization for 'arg.<anonymous>')
> 
> Fixes: 2127d95aef6c ("ipv6: Clear nexthop flags upon netdev up")
> Cc: Ido Schimmel <idosch@mellanox.com>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Ido sent me a patch which fixes this and it's in my net-next tree now.

Thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-15 19:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-13  0:18 [patch 1/1] net/ipv6/route.c: work around gcc-4.4.4 anon union initializer issue akpm
2018-01-15 19:28 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).