>-----Original Message----- >From: Andrzej Ostruszka [mailto:aostrus...@marvell.com] >Sent: Tuesday, October 29, 2019 7:12 AM >To: dev@dpdk.org; Wang, Yipeng1 <yipeng1.w...@intel.com>; Gobriel, Sameh ><sameh.gobr...@intel.com>; Richardson, Bruce ><bruce.richard...@intel.com>; Chas Williams <ch...@att.com>; Burakov, Anatoly ><anatoly.bura...@intel.com> >Cc: mattias.ronnb...@ericsson.com; step...@networkplumber.org >Subject: [PATCH v6 07/12] app/test: clean LTO build warnings >(maybe-uninitialized) > >During LTO build compiler reports some 'false positive' warnings about >variables being possibly used uninitialized. This patch silences these >warnings. > >Exemplary compiler warning to suppress (with LTO enabled): >error: ‘stats.greatest_free_size’ may be used uninitialized in this >function [-Werror=maybe-uninitialized] > return len - overhead; > >Signed-off-by: Andrzej Ostruszka <aostrus...@marvell.com> >--- > app/test/test_hash_readwrite.c | 2 +- > app/test/test_link_bonding_mode4.c | 8 +++++++- > app/test/test_memzone.c | 3 ++- > 3 files changed, 10 insertions(+), 3 deletions(-) > >diff --git a/app/test/test_hash_readwrite.c b/app/test/test_hash_readwrite.c >index 4376b099b..615767fb6 100644 >--- a/app/test/test_hash_readwrite.c >+++ b/app/test/test_hash_readwrite.c >@@ -298,7 +298,7 @@ test_rw_reader(void *arg) > > begin = rte_rdtsc_precise(); > for (i = 0; i < read_cnt; i++) { >- void *data; >+ void *data = arg;
[Wang, Yipeng] Hi Andrzej, thanks for the fix! Maybe you could initialize the data to be "NULL"? I think it makes more sense to be NULL rather than arg.