From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2 2/2] use simple zero initializers Date: Thu, 16 Apr 2015 14:55:29 +0200 Message-ID: <5787146.HQ8pXXMOKN@xps13> References: <1958525.YbKd0lDtje@xps13> <1429130956-17828-2-git-send-email-thomas.monjalon@6wind.com> <552F8B09.9070000@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Olivier MATZ Return-path: In-Reply-To: <552F8B09.9070000-pdR9zngts4EAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 2015-04-16 12:12, Olivier MATZ: > On 04/15/2015 10:49 PM, Thomas Monjalon wrote: > > To initialize a structure with zeros, one field was explicitly set > > to avoid "missing initializer" bug with old GCC (e.g. 4.4). > > This warning is now disabled (commit ) for old versions of GCC, > > so the workarounds may be removed. > > > > These initializers should not be needed for static variables but they > > are still used to workaround an ICC bug (see commit b2595c4aa92d). > > > > There is one remaining exception where {0} initializer doesn't work cleanly, > > even with recent GCC: > > lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c:735:9: > > error: missing braces around initializer [-Werror=missing-braces] > > struct rte_mbuf mb_def = {0}; /* zeroed mbuf */ > > > > Tested with GCC 4.4.7 (CentOS), 4.7.2 (Debian) and 4.9.2 (Arch). > > > > Signed-off-by: Thomas Monjalon > > I'm trying to compile the head of dpdk (without this patch applied), > and I have this error with clang: > > ixgbe_rxtx.c:2509:41: error: missing field 'driver_name' initializer > [-Werror,-Wmissing-field-initializers] > struct rte_eth_dev_info dev_info = { 0 }; > > I'm wondering if adding more {0} would compile on clang, at least with > the current clang flags. It's fixed by adding -Wno-missing-field-initializers to clang flags. Someone to test with ICC? Thanks