[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201102231919.n2isaam3xefujycs@skbuf>
Date: Mon, 2 Nov 2020 23:19:20 +0000
From: Vladimir Oltean <vladimir.oltean@....com>
To: Jakub Kicinski <kuba@...nel.org>
CC: Pujin Shi <shipujin.t@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Microchip Linux Driver Support <UNGLinuxDriver@...rochip.com>,
Claudiu Manoil <claudiu.manoil@....com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Xiaoliang Yang <xiaoliang.yang_1@....com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net: ethernet: mscc: fix missing brace warning for old
compilers
On Mon, Nov 02, 2020 at 02:08:08PM -0800, Jakub Kicinski wrote:
> Old GCC does not like the 0, if the members of struct are not scalars.
>
> struct ocelot_vcap_u16 {
> u8 value[2];
> u8 mask[2];
> };
>
> In this case the first member is an array.
>
> It wants us to add another curly brace:
>
> struct ocelot_vcap_u16 etype = {{0}};
>
> ... or we can just skip the 0.
I am reading that the empty set initializer is a GNU extension. I would
not like to see yet another patch from clang folks coming as a follow-up
to this one.
> That's just FWIW. I don't remember which versions of GCC behave like
> that, I just know we get a constant stream of this sort of fixes.
> I think clang may generate a similar warning.
>
> Pujin, please specify the version of GCC you're using and repost.
If the initializer really has to be changed, I would prefer to see a memset.
Powered by blists - more mailing lists