use simple zero initializers
authorThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 15 Apr 2015 17:09:28 +0000 (19:09 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 20 Apr 2015 12:37:36 +0000 (14:37 +0200)
commitf12f13f2f67d26029eaccae15b92561e3554af3a
tree1af8667db02aca04b619ab17f9b59380073189da
parente74c4e0938b09dad487d7b2b067bf209e32e1398
use simple zero initializers

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@6wind.com>
Tested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: John McNamara <john.mcnamara@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Vlad Zolotarov <vladz@cloudius-systems.com>
app/test/test_ring_perf.c
lib/librte_pmd_e1000/em_ethdev.c
lib/librte_pmd_e1000/igb_ethdev.c
lib/librte_pmd_e1000/igb_rxtx.c
lib/librte_pmd_enic/enic_clsf.c
lib/librte_pmd_i40e/i40e_rxtx.c
lib/librte_pmd_ixgbe/ixgbe_rxtx.c
lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
lib/librte_pmd_mlx4/mlx4.c