[cfe-dev] Warn if a variable marked with the "unused" attribute is used

Jean-Daniel Dupas devlists at shadowlab.org
Sat Oct 23 08:57:16 PDT 2010


Hello,

I just saw that clang warn when a variable marked unused is used.  How can I disable this warning but keeping unused warning.

I have to declare a static functions in a header that get include in lot of files, and I want neither 'unused function' warnings nor 'marked unused but used' warnings.

And some generated code relies on the old behavior (MIG generated stubs for instance heavily use the unused attribute and produce a lot of warnings), 
so I'm not sure that enabling it by default when using -Wunused is a good idea.

-- Jean-Daniel








More information about the cfe-dev mailing list