[llvm] r194486 - Revert "Remove unused variable."

David Blaikie dblaikie at gmail.com
Tue Nov 12 08:57:03 PST 2013


On Tue, Nov 12, 2013 at 8:54 AM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> On 12 November 2013 11:47, David Blaikie <dblaikie at gmail.com> wrote:
> > Not necessarily possible/practical, since the macros could refer to
> > different names based on the context in which they're used, etc (and
> there's
> > only so much we can do to parse uninstantiated code)
>
> I was thinking of something like "don't warn if the variable is
> defined inside a macro".
>
>
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.


> > Usually for cases where we have a debug variable that's used in asserts
> but
> > not otherwise, we either #ifndef NDEBUG the variable, or add a
> "(void)var;"
> > near the assert.
>

This is probably irrelevant and due to my misunderstanding of the use being
macro'd rather than the definition.


>
> Cheers,
> Rafael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131112/a8afd3d5/attachment.html>


More information about the llvm-commits mailing list