[dpdk-dev] [PATCH v3 2/2] use simple zero initializers

Thomas Monjalon thomas.monjalon at 6wind.com
Mon Apr 20 14:45:12 CEST 2015


> > 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 <insertlater>) 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), gcc-4.7.2 (Debian), gcc-4.9.2 (Arch),
> > clang-3.6.0 and icc-13.1.1.
> >
> > Signed-off-by: Thomas Monjalon <thomas.monjalon at 6wind.com>
> > Tested-by: Thomas Monjalon <thomas.monjalon at 6wind.com>
> > Tested-by: John McNamara <john.mcnamara at intel.com>
> 
> Acked-by: Vlad Zolotarov <vladz at cloudius-systems.com>

Applied, thanks


More information about the dev mailing list