diff --git a/crypto/thread_test.c b/crypto/thread_test.c index bc6bfa74..714bef7a 100644 --- a/crypto/thread_test.c +++ b/crypto/thread_test.c @@ -100,6 +100,9 @@ static void call_once_thread(void) { CRYPTO_once(&g_test_once, once_init); } +static CRYPTO_once_t once_init_value = CRYPTO_ONCE_INIT; +static CRYPTO_once_t once_bss; + static int test_once(void) { if (g_once_init_called != 0) { fprintf(stderr, "g_once_init_called was non-zero at start.\n"); @@ -126,10 +129,8 @@ static int test_once(void) { if (FIPS_mode()) { /* Our FIPS tooling currently requires that |CRYPTO_ONCE_INIT| is all * zeros, so the |CRYPTO_once_t| is placed in the bss. */ - static const CRYPTO_once_t once_init_value = CRYPTO_ONCE_INIT; - static const CRYPTO_once_t once_bss; - if (OPENSSL_memcmp(&once_init_value, &once_bss, sizeof(CRYPTO_once_t)) != - 0) { + if (OPENSSL_memcmp((void *)&once_init_value, (void *)&once_bss, + sizeof(CRYPTO_once_t)) != 0) { fprintf(stderr, "CRYPTO_ONCE_INIT did not expand to all zeros.\n"); return 0; }