[llvm] r194486 - Revert "Remove unused variable."
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
> > 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
> > not otherwise, we either #ifndef NDEBUG the variable, or add a
> > near the assert.
This is probably irrelevant and due to my misunderstanding of the use being
macro'd rather than the definition.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits