[dpdk-dev] [PATCH v6 07/12] app/test: clean LTO build warnings (maybe-uninitialized)
Wang, Yipeng1
yipeng1.wang at intel.com
Fri Nov 1 18:15:11 CET 2019
>-----Original Message-----
>From: Andrzej Ostruszka [mailto:aostruszka at marvell.com]
>Sent: Tuesday, October 29, 2019 7:12 AM
>To: dev at dpdk.org; Wang, Yipeng1 <yipeng1.wang at intel.com>; Gobriel, Sameh <sameh.gobriel at intel.com>; Richardson, Bruce
><bruce.richardson at intel.com>; Chas Williams <chas3 at att.com>; Burakov, Anatoly <anatoly.burakov at intel.com>
>Cc: mattias.ronnblom at ericsson.com; stephen at 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 <aostruszka at 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.
More information about the dev
mailing list