From: Deven Dighe Date: Thu, 19 Mar 2026 13:54:21 +0000 (-0400) Subject: crypto/threads_win.c: type casted destination of InterlockedExchange{,64} calls X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=efbcbc3612b074ec6d00ce00fa9535548d2a6517;p=thirdparty%2Fopenssl.git crypto/threads_win.c: type casted destination of InterlockedExchange{,64} calls Explicitly cast dst argument of InterlockedExchange{,64} calls in CRYPTO_atomic_store{,_int}() to LONG{64,} volatile *, respectively, to work around incompatible pointer type errors on 64-bit MinGW builds. Initially Reported by Splediferous. [esyr: massaged the commit message a bit] CLA: trivial Resolves: https://github.com/openssl/openssl/issues/30451 Fixes: cc7195da3038 "Make FIPS self test state access atomic" Fixes: 7e45ac6891ad "Add CRYPTO_atomic_store api" add cast to LONG volatile * for InterlockedExchange Reviewed-by: Neil Horman Reviewed-by: Paul Dale Reviewed-by: Eugene Syromiatnikov MergeDate: Sun Mar 22 00:56:36 2026 (Merged from https://github.com/openssl/openssl/pull/30504) --- diff --git a/crypto/threads_win.c b/crypto/threads_win.c index db247960098..525c8d432e6 100644 --- a/crypto/threads_win.c +++ b/crypto/threads_win.c @@ -710,7 +710,7 @@ int CRYPTO_atomic_store(uint64_t *dst, uint64_t val, CRYPTO_RWLOCK *lock) return 1; #else - InterlockedExchange64(dst, val); + InterlockedExchange64((LONG64 volatile *)dst, val); return 1; #endif } @@ -743,7 +743,7 @@ int CRYPTO_atomic_store_int(int *dst, int val, CRYPTO_RWLOCK *lock) return 1; #else - InterlockedExchange(dst, val); + InterlockedExchange((LONG volatile *)dst, val); return 1; #endif }