GraphBLAS: Avoid warning from Clang 17. #831
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Clang 17 emits more warnings (or errors) when it comes to incompatible pointer types.
_InterlockedCompareExchange
is declared withlong volatile *
as the type of its first input argumentSee: https://learn.microsoft.com/en-us/cpp/intrinsics/interlockedcompareexchange-intrinsic-functions?view=msvc-170
int32_t
isint
on Windows. Whilelong
andint
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.
Without this change,
clang-cl
17 emits warnings like the following:https://github.com/DrTimothyAldenDavis/SuiteSparse/actions/runs/9404241025/job/25902701998#step:16:3057
(Side note: I'm unsure where to open PRs wrt GraphBLAS. I opted for this repository because there is CI here.)