[llvm-commits] [llvm] r116909 - in /llvm/trunk/lib/System: RWMutex.cpp Win32/ThreadLocal.inc
Bill Wendling
wendling at apple.com
Wed Oct 20 17:35:21 PDT 2010
On Oct 19, 2010, at 11:54 PM, Duncan Sands wrote:
>> // Initialize the rwlock
>> - int errorcode = pthread_rwlock_init(rwlock, NULL);
>> - (void)errorcode;
>> + int ATTRIBUTE_UNUSED errorcode = pthread_rwlock_init(rwlock, NULL);
>> assert(errorcode == 0);
>
> when building with assertions on, errorcode is used, so mightn't this result
> in a warning? [*] I don't see what was wrong with casting to void: that's used
> all over the place in LLVM already, not to mention in lots of other projects.
>
When I created that macro, I tested it out with that situation on GCC. It didn't produce a warning. Can you come up with a situation and compiler where it does?
-bw
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101020/fe43f88d/attachment.html>
More information about the llvm-commits
mailing list