>-----Original Message-----
>From: Andrzej Ostruszka [mailto:[email protected]]
>Sent: Tuesday, October 29, 2019 7:12 AM
>To: [email protected]; Wang, Yipeng1 <[email protected]>; Gobriel, Sameh 
><[email protected]>; Richardson, Bruce
><[email protected]>; Chas Williams <[email protected]>; Burakov, Anatoly 
><[email protected]>
>Cc: [email protected]; [email protected]
>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 <[email protected]>
>---
> 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.
 

Reply via email to