Skip to content

Commit

Permalink
Fix set-but-unused variable warning
Browse files Browse the repository at this point in the history
  • Loading branch information
vaintroub committed Sep 8, 2023
1 parent e44c804 commit 28861d9
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/tests/cpu/sb_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,8 @@ sb_event_t cpu_next_event(int thread_id)
return req;
}

#if defined _MSC_VER && !defined __clang__
/*
MSVC would optimize away the whole function
if optimizations are on.
*/
#pragma optimize("g", off)
#endif
/* helps to avoid compilers optimizing cpu_execute_event() away */
static thread_local unsigned long long thread_count_primes;

int cpu_execute_event(sb_event_t *r, int thread_id)
{
Expand All @@ -123,14 +118,10 @@ int cpu_execute_event(sb_event_t *r, int thread_id)
if (l > t )
n++;
}

thread_count_primes= n;
return 0;
}

#if defined _MSC_VER && !defined __clang__
#pragma optimize("", on)
#endif

void cpu_print_mode(void)
{
log_text(LOG_INFO, "Doing CPU performance benchmark\n");
Expand Down

0 comments on commit 28861d9

Please sign in to comment.