From 1f5a5592a8e5ff8cc84ec20f3e87c5d0ab46cfb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Fri, 7 Jun 2024 10:34:43 +0200 Subject: [PATCH] GraphBLAS: Avoid warning from Clang 17. Clang 17 emits more warnings (or errors) when it comes to incompatible pointer types. `_InterlockedCompareExchange` is declared with `long volatile *` as the type of its first input argument See: https://learn.microsoft.com/en-us/cpp/intrinsics/interlockedcompareexchange-intrinsic-functions?view=msvc-170 `int32_t` is `int` on Windows. While `long` and `int` have the same size on Windows (LLP64 data model), they are technically distinct types. Avoid the compiler warning by casting to the pointer type expected by that function. --- GraphBLAS/Source/omp/include/GB_atomics.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GraphBLAS/Source/omp/include/GB_atomics.h b/GraphBLAS/Source/omp/include/GB_atomics.h index 94535663f..c59078b45 100644 --- a/GraphBLAS/Source/omp/include/GB_atomics.h +++ b/GraphBLAS/Source/omp/include/GB_atomics.h @@ -410,7 +410,7 @@ #define GB_ATOMIC_COMPARE_EXCHANGE_32(target, expected, desired) \ ( \ GB_PUN (int32_t, expected) == \ - _InterlockedCompareExchange ((int32_t volatile *) (target), \ + _InterlockedCompareExchange ((long volatile *) (target), \ GB_PUN (int32_t, desired), GB_PUN (int32_t, expected)) \ )