[PATCH] Quiet the warning of unused return value
I get a warning as the return value is not checked from dispatch_atomic_cmpxchg() - as it is in all other 11 usages of it. Attached is a patch that just discards the return value accordingly to quiet this warning. Joakim Index: src/queue.c =================================================================== --- src/queue.c (revision 197) +++ src/queue.c (working copy) @@ -377,7 +377,7 @@ // The first xchg on the tail will tell the enqueueing thread that it // is safe to blindly write out to the head pointer. A cmpxchg honors // the algorithm. - dispatch_atomic_cmpxchg(&dq->dq_items_head, mediator, NULL); + (void) dispatch_atomic_cmpxchg(&dq->dq_items_head, mediator, NULL); _dispatch_debug("no work on global work queue"); return NULL; }
On 05/28/2011 08:28 AM, Joakim Johansson wrote:
I get a warning as the return value is not checked from dispatch_atomic_cmpxchg() - as it is in all other 11 usages of it.
Attached is a patch that just discards the return value accordingly to quiet this warning.
I have created a HOWTO site for building and using libdispatch here: http://mark.heily.com/libdispatch I've added the two patches you just sent, along with the other patches that are needed to build on Linux. Cheers, - Mark
participants (2)
-
Joakim Johansson
-
Mark Heily