Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Factory:Rebuild
libdispatch
prevent_unused.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File prevent_unused.patch of Package libdispatch
From 915f25141a7c57b6a2a3bc8697572644af181ec5 Mon Sep 17 00:00:00 2001 From: Ben Barham <ben_barham@apple.com> Date: Mon, 6 Jun 2022 10:45:27 -0700 Subject: [PATCH] Prevent unused but set variable warning `_dispatch_preemption_yield(++spins)` has an expansion to `(void)++spins`, but this isn't considered a use of `spins` in Clang. Add a `(void)spins` to prevent an unused variable warning. Resolves rdar://93596069. --- src/shims/yield.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) 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);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor