summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2023-07-05 11:30:41 +0200
committerGeert Uytterhoeven <geert@linux-m68k.org>2023-07-05 11:47:40 +0200
commitdba87e7bb0a024f77549221ffa8e388c6a3b2a6a (patch)
treeea7cf28231a51b0d8d80bf9b5c178cb919614fbd
parent47f6351b7c227308b213285d9fd3c1affa53871a (diff)
downloadfbtest-dba87e7bb0a024f77549221ffa8e388c6a3b2a6a.tar.gz
Initialize ticks in benchmark()HEADmaster
Fixes a build error due to a false positive possible uninitialized use warning with GCC 13: util.c: In function 'benchmark': util.c:177:17: error: 'ticks' may be used uninitialized [-Werror=maybe-uninitialized] util.c:161:14: note: 'ticks' was declared here Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://lore.kernel.org/r/20230705093041.422391-1-p.zabel@pengutronix.de Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index cdf89b3..f199ace 100644
--- a/util.c
+++ b/util.c
@@ -158,7 +158,7 @@ static uint64_t get_ticks(void)
double benchmark(void (*func)(unsigned long n, void *data), void *data)
{
- uint64_t ticks;
+ uint64_t ticks = 1;
unsigned long n = 1;
printf("Benchmarking... ");