From 4af1119877d4348ecfb089863eb965aaa6571454 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 18 Feb 2022 10:11:14 +0300 Subject: Eliminate 'exper_n is declared but not used' compiler warning if NO_TIMES (fix of commit cfd0593f3) * tests/test_stack.c (output_stat): Do not declare exper_n local variable if NO_TIMES; move exper_n to the inner scope. --- tests/test_stack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_stack.c b/tests/test_stack.c index ab4c0a2..367cda5 100644 --- a/tests/test_stack.c +++ b/tests/test_stack.c @@ -341,11 +341,12 @@ void run_all_experiments(int max_nthreads) /* Output the performance statistic. */ void output_stat(int max_nthreads) { - int nthreads, exper_n; + int nthreads; assert(max_nthreads <= MAX_NTHREADS); for (nthreads = 1; nthreads <= max_nthreads; ++nthreads) { # ifndef NO_TIMES + int exper_n; unsigned long sum = 0; # endif -- cgit v1.2.1