summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-02-18 10:11:14 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-02-18 12:12:51 +0300
commit4af1119877d4348ecfb089863eb965aaa6571454 (patch)
treeb93e0a00feb5d17319b468aaf15ff1e1317a1360
parentcfd0593f3fbab8c97bfb59c83a0616dbafd7ca9b (diff)
downloadlibatomic_ops-4af1119877d4348ecfb089863eb965aaa6571454.tar.gz
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.
-rw-r--r--tests/test_stack.c3
1 files changed, 2 insertions, 1 deletions
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