<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Oct 19, 2010, at 11:54 PM, Duncan Sands wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><blockquote type="cite">     // Initialize the rwlock<br></blockquote><blockquote type="cite">-    int errorcode = pthread_rwlock_init(rwlock, NULL);<br></blockquote><blockquote type="cite">-    (void)errorcode;<br></blockquote><blockquote type="cite">+    int ATTRIBUTE_UNUSED errorcode = pthread_rwlock_init(rwlock, NULL);<br></blockquote><blockquote type="cite">      assert(errorcode == 0);<br></blockquote><br>when building with assertions on, errorcode is used, so mightn't this result<br>in a warning? [*] I don't see what was wrong with casting to void: that's used<br>all over the place in LLVM already, not to mention in lots of other projects.<br><br></div></blockquote><div>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?</div></div><div><br></div><div>-bw</div><div><br></div></body></html>