[cfe-dev] Unused argument during compilation

Chris Lattner clattner at apple.com
Wed May 19 11:35:43 PDT 2010


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.





More information about the cfe-dev mailing list