[cfe-dev] ccache and 'unused argument' warning

Daniel Dunbar daniel at zuster.org
Tue Jun 22 22:08:42 PDT 2010


Hi Chris,

I plan to reduce some of the noise from clang's "warning: argument
unused" by trying to be a bit smarter about when the warning would be
interesting. That should reduce some of the noise, although perhaps
not all. This work is a low priority for me though...

For now, one can use -Qunused-arguments to suppress the warning.

 - Daniel

On Fri, Jun 18, 2010 at 10:30 PM, Chris Lattner <clattner at apple.com> wrote:
> A user who uses ccache reported that it is apparently doing something that causes it to emit tons of "argument unused during compilation warnings".  A typical invocation is something like this:
>
> ccache clang++ -m32 -mmmx -msse  -pipe -march=pentium-m -I/usr/include/malloc -fasm-blocks -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -Wno-invalid-offsetof -Wno-unknown-pragmas -Wno-unused-parameter -Wno-reorder -Wno-unused-value -Wno-missing-field-initializers -Wno-sign-compare -Wno-invalid-offsetof -Wno-write-strings -gdwarf-2 -g2 -O3 -fno-strict-aliasing -DNDEBUG -DGNUC -DPOSIX -D_OSX -DOSX -Ifoo -c foo.cpp -o foo.o
>
> which produces warnings like this:
> clang: warning: argument unused during compilation: '-c'
> clang: warning: argument unused during compilation: '-I/usr/include/malloc'
> clang: warning: argument unused during compilation: '-isysroot /Developer/SDKs/MacOSX10.5.sdk'
> clang: warning: argument unused during compilation: '-DNDEBUG'
> clang: warning: argument unused during compilation: '-DGNUC'
> clang: warning: argument unused during compilation: '-DPOSIX'
> clang: warning: argument unused during compilation: '-D_OSX'
> clang: warning: argument unused during compilation: '-DOSX'
> clang: warning: argument unused during compilation: '-Ifoo'
>
> etc.  This is apparently local to something that ccache is doing: it must be running clang multiple times, one with some funny options.  The user was alarmed because he didn't think that clang had implemented such exotic options as -D and -I :) due to these warnings.
>
> The question is: is this a ccache bug, or should we hack clang somehow to work better with ccache?  I don't use ccache or know anything about it, so I don't really have an opinion here.
>
> -Chris
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>




More information about the cfe-dev mailing list