From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phil Sutter Subject: Re: [iproute PATCH v3 0/6] Big C99 style initializer rework Date: Mon, 27 Jun 2016 20:23:02 +0200 Message-ID: <20160627182302.GB13664@orbyte.nwl.cc> References: <20160627105912.7961c3f4@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Daniel Borkmann , David Ahern , Nicolas Dichtel , Julien Floret , "netdev@vger.kernel.org" To: Stephen Hemminger Return-path: Received: from orbyte.nwl.cc ([151.80.46.58]:43381 "EHLO mail.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751638AbcF0SXE (ORCPT ); Mon, 27 Jun 2016 14:23:04 -0400 Content-Disposition: inline In-Reply-To: <20160627105912.7961c3f4@xeon-e3> Sender: netdev-owner@vger.kernel.org List-ID: Hi, On Mon, Jun 27, 2016 at 10:59:12AM -0700, Stephen Hemminger wrote: > On Thu, 23 Jun 2016 17:34:08 +0000 > Phil Sutter wrote: >=20 > > This is v3 of my C99-style initializer related patch series. The ch= anges > > since v2 are: [...] >=20 > I like the idea and it makes code cleaner. But doing this introduces = lots of warnings > and that is not acceptable. > ip > CC ip.o > CC ipaddress.o > ipaddress.c: In function =E2=80=98print_queuelen=E2=80=99: > ipaddress.c:175:10: warning: missing braces around initializer [-Wmis= sing-braces] > struct ifreq ifr =3D { 0 }; > ^ I saw these too with gcc-3.4.6 but not with 5.3.0. It appears to be a gcc bug[1]. One possible workaround is to match the brace level of the first field, but it's quite ugly: [2]. Another way might be to initialize one of the fields to zero, like so: | struct ifreq ifr =3D { .ifr_qlen =3D 0 }; What do you think? Thanks, Phil [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D53119 [2] http://nwl.cc/cgi-bin/git/gitweb.cgi?p=3Diproute2.git;a=3Dcommitdif= f;h=3Da1cbf2b63c995b2f633c5b4699248ab308b201d2;hp=3D3809cfec65b03716d1d= 0360338126df4b4f3fbf6