From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 1209FADA2 for ; Thu, 16 Apr 2015 12:12:28 +0200 (CEST) Received: by wgso17 with SMTP id o17so75364889wgs.1 for ; Thu, 16 Apr 2015 03:12:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=s0FQ+3bRCOvMCI/MNT2bLsBqsbJjk8dvIVsAc6c82A4=; b=J4Zh17z63NfMgF7njBoK9r7JbqMWtqjENXdRtluScXzvTgJAp8mkcqpNMaleXRDpK/ AiRlHyDm1ShS8H0qVKeTqvOEYnDdEvtzwL4aevX7+poamCME66Gxe1jRtMe4qVS7LCcM ZfzsqV/uRvTvfRpIO4dxFDnb6L2Piy1kDVsfIhDbE0fvA8wnY3GbQ7HAjXKYpiN0bWLt Jr+M1Ap3xhz41rjrtyBytSQLLSW80HlrE340IeN+EmYZ7QXEp6Nu782NzFxFCm0V4wY5 9FwQwuIZ8oPOopZLKkFcIm3QyGiz2u0BQyjvosaHXklHeYuu09sCHRvFlIHE2SLdBR/L cboQ== X-Gm-Message-State: ALoCoQn+lZzppMLPRNAsPtKzQxLsxQL0q3eN63fyYUar36J/gBRM0BxH1zy3qn1GLahexVWxsxvm X-Received: by 10.180.7.134 with SMTP id j6mr3831577wia.9.1429179147974; Thu, 16 Apr 2015 03:12:27 -0700 (PDT) Received: from [10.16.0.195] (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id hu1sm10942261wib.6.2015.04.16.03.12.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Apr 2015 03:12:27 -0700 (PDT) Message-ID: <552F8B09.9070000@6wind.com> Date: Thu, 16 Apr 2015 12:12:25 +0200 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 MIME-Version: 1.0 To: Thomas Monjalon , dev@dpdk.org References: <1958525.YbKd0lDtje@xps13> <1429130956-17828-1-git-send-email-thomas.monjalon@6wind.com> <1429130956-17828-2-git-send-email-thomas.monjalon@6wind.com> In-Reply-To: <1429130956-17828-2-git-send-email-thomas.monjalon@6wind.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 2/2] use simple zero initializers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 10:12:28 -0000 Hi Thomas, 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. $ clang --version Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0) Target: x86_64-pc-linux-gnu Thread model: posix Regards, Olivier