<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Oct 20, 2010, at 1:44 AM, Chandler Carruth wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Author: chandlerc<br>Date: Wed Oct 20 03:44:27 2010<br>New Revision: 116920<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=116920&view=rev">http://llvm.org/viewvc/llvm-project?rev=116920&view=rev</a><br>Log:<br>Add a comment about ATTRIBUTE_UNUSED to avoid further confusion over when to<br>use it.<br><br></div></blockquote><div>There's no reason not to use this for variables. And it avoids the void-casting hack.</div><div><br></div><div>-bw</div><br><blockquote type="cite"><div>Modified:<br>    llvm/trunk/include/llvm/Support/Compiler.h<br><br>Modified: llvm/trunk/include/llvm/Support/Compiler.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=116920&r1=116919&r2=116920&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compiler.h?rev=116920&r1=116919&r2=116920&view=diff</a><br>==============================================================================<br>--- llvm/trunk/include/llvm/Support/Compiler.h (original)<br>+++ llvm/trunk/include/llvm/Support/Compiler.h Wed Oct 20 03:44:27 2010<br>@@ -31,6 +31,14 @@<br> #define ATTRIBUTE_USED<br> #endif<br><br>+// Some compilers warn about unused functions. When a function is sometimes<br>+// used or not depending on build settings (e.g. a function only called from<br>+// within "assert"), this attribute can be used to suppress such warnings.<br>+//<br>+// However, it shouldn't be used for unused *variables*, as those have a much<br>+// more portable solution:<br>+//   (void)unused_var_name;<br>+// Prefer cast-to-void wherever it is sufficient.<br> #if (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))<br> #define ATTRIBUTE_UNUSED __attribute__((__unused__))<br> #else<br><br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br></div></blockquote></div><br></body></html>