[cfe-dev] Unused argument during compilation

David Chisnall csdavec at swan.ac.uk
Thu May 20 03:57:54 PDT 2010


On 19 May 2010, at 19:35, Chris Lattner wrote:

> On May 19, 2010, at 5:24 AM, David Chisnall wrote:
> 
>> Hi,
>> 
>> When I compile stuff with clang, I get a lot of noise in the output saying 'unused argument during compilation'.  This is because various layers of makefiles add things to the CFLAGS without checking whether they are already there.  If you specify -O2 twice, for example, clang will give you a misleading warning that -O2 is unused - in fact, it is used, but it's only used once.  The same is true for various other directives.  
>> 
>> Is it possible to suppress this, and only warn about options that really aren't used, rather than ones that are specified more times than they are used?  
> 
> Doesn't it have a [-Wfoo] option specified?  This means you can pass -Wno-foo to turn this warning off.


You can turn off the unused argument warning in general, but then you won't get a warning when you pass an argument that is wrong for this compilation phase, or which clang doesn't understand.

David

-- Sent from my Difference Engine




More information about the cfe-dev mailing list