From 461ae02c50ddc904564daf885677b1f50a0af81d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 10 Jun 2021 20:31:58 +1000 Subject: [PATCH] test: shut up a compiler warning about an unused variable gcc 9 complains about `v` being potentially uninitialized. This is a false positive, we'd exit() on any error before using `v` but the compiler doesn't seem to know that. Let's shut up the warning. --- test/test-spa-utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test-spa-utils.c b/test/test-spa-utils.c index 5c0c8dfd9..77867b693 100644 --- a/test/test-spa-utils.c +++ b/test/test-spa-utils.c @@ -483,7 +483,7 @@ PWTEST(utils_ringbuffer) PWTEST(utils_strtol) { - int32_t v; + int32_t v = 0xabcd; pwtest_bool_true(spa_atoi32("0", &v, 0)); pwtest_int_eq(v, 0); pwtest_bool_true(spa_atoi32("0", &v, 16)); pwtest_int_eq(v, 0); @@ -532,7 +532,7 @@ PWTEST(utils_strtol) PWTEST(utils_strtoul) { - uint32_t v; + uint32_t v = 0xabcd; pwtest_bool_true(spa_atou32("0", &v, 0)); pwtest_int_eq(v, 0U); pwtest_bool_true(spa_atou32("0", &v, 16)); pwtest_int_eq(v, 0U); @@ -582,7 +582,7 @@ PWTEST(utils_strtoul) PWTEST(utils_strtoll) { - int64_t v; + int64_t v = 0xabcd; pwtest_bool_true(spa_atoi64("0", &v, 0)); pwtest_int_eq(v, 0); pwtest_bool_true(spa_atoi64("0", &v, 16)); pwtest_int_eq(v, 0); @@ -629,7 +629,7 @@ PWTEST(utils_strtoll) PWTEST(utils_strtof) { - float v; + float v = 0xabcd; setlocale(LC_NUMERIC, "C"); /* For decimal number parsing */ @@ -654,7 +654,7 @@ PWTEST(utils_strtof) PWTEST(utils_strtod) { - double v; + double v = 0xabcd; pwtest_bool_true(spa_atod("0", &v)); pwtest_double_eq(v, 0.0); pwtest_bool_true(spa_atod("0.00", &v)); pwtest_double_eq(v, 0.0);