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

Justin Bogner mail at justinbogner.com
Sat Jun 19 21:55:56 PDT 2010


Jakob Stoklund Olesen <stoklund at 2pi.dk> writes:
> ccache runs the compiler twice: First with -E to create a preprocessed
> file, second it compiles the preprocessed file if it doesn't have a
> matching object file in its cache.
>
> On the first run, '-c' is unused because -E was added.  On the second
> run, '-I', '-D', and '-isysroot' are ignored because the preprocessor
> isn't run.
>
> I am guessing that ccache doesn't know what clang is, so it doesn't
> remove any options, just to be sure.

This makes sense. In my own use of clang with ccache I've noticed that
it complains about -c being unused for each source file it compiles.

I don't think ccache knows what gcc is either, but gcc doesn't complain
about -c being unused when you do `gcc -c -E foo.c`.




More information about the cfe-dev mailing list