From 80da8a8fbbc82356eee6aaad7ac7a28443f8dff6 Mon Sep 17 00:00:00 2001 From: Bruce Cran Date: Thu, 21 Feb 2013 14:16:17 +0100 Subject: [PATCH] Declare 'prev' and 'this' outside the loop to avoid clang warning about 'prev' being uninitialized Signed-off-by: Jens Axboe --- gettime.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gettime.c b/gettime.c index cc9dcb7b..5b85a23b 100644 --- a/gettime.c +++ b/gettime.c @@ -501,6 +501,7 @@ int fio_monotonic_clocktest(void) unsigned int nr_cpus = cpus_online(); struct clock_entry *entries; unsigned long tentries, failed; + struct clock_entry *prev, *this; uint64_t seq = 0; int i; @@ -558,7 +559,7 @@ int fio_monotonic_clocktest(void) qsort(entries, tentries, sizeof(struct clock_entry), clock_cmp); for (failed = i = 0; i < tentries; i++) { - struct clock_entry *prev, *this = &entries[i]; + this = &entries[i]; if (!i) { prev = this; -- 2.25.1