diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c5412ce59..adc989d42 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,4 @@ -# Remove once underlying clang warning is fixed (rdar://93596069) -set_source_files_properties(shims/yield.c PROPERTIES COMPILE_FLAGS -Wno-error=unused-but-set-variable) - if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) add_subdirectory(BlocksRuntime) endif() diff --git a/src/shims/yield.c b/src/shims/yield.c index d0c5fff92..cf1f5cefd 100644 --- a/src/shims/yield.c +++ b/src/shims/yield.c @@ -25,6 +25,11 @@ static void * __DISPATCH_WAIT_FOR_ENQUEUER__(void **ptr) { int spins = 0; + // Different platforms may expand `_dispatch_preemption_yield` to a + // no-op, but `(void)++spins` is not considered a use like + // `(void)spins` is. Add a use to avoid unused var warnings. + (void)spins; + void *value; while ((value = os_atomic_load(ptr, relaxed)) == NULL) { _dispatch_preemption_yield(++spins);