<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 12, 2013 at 8:54 AM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 12 November 2013 11:47, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>

> Not necessarily possible/practical, since the macros could refer to<br>
> different names based on the context in which they're used, etc (and there's<br>
> only so much we can do to parse uninstantiated code)<br>
<br>
</div>I was thinking of something like "don't warn if the variable is<br>
defined inside a macro".<br>
<div class="im"><br></div></blockquote><div><br></div><div>Ah, right, I see - yes, this is a common problem with -Wunused (expressions, functions, variables, and even dead-code) warnings. The suppressions in Clang for cases like these have been added somewhat ad-hoc-ly and are inconsistent over the different cases. It might be worth tidying them all up and taking a general approach.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
> Usually for cases where we have a debug variable that's used in asserts but<br>
> not otherwise, we either #ifndef NDEBUG the variable, or add a "(void)var;"<br>
> near the assert.<br></div></blockquote><div><br></div><div>This is probably irrelevant and due to my misunderstanding of the use being macro'd rather than the definition.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
<br>
</div>Cheers,<br>
Rafael<br>
</blockquote></div><br></div></div>