clang: warning: argument unused during compilation: '-c' clang: warning: argument unused during compilation: '-I .'These are harmless, but if you want to get rid of them, use the clang option -Qunused-arguments, which will hide them. (The first one is already fixed in ccache.)
The reason for this is that ccache splits the compilation into separate calls to the preprocessor and the compiler proper, and it tries to sort out which of the options that you called it with go with which call. But since gcc doesn't complain about passing -c to the preprocessor or -I to the compiler, ccache doesn't bother about sorting this out (bug). That's why you don't lose any information relative to using gcc if you use the -Qunused-arguments option.
Also, if you like clang's colored diagnostics messages, you'll have to turn them on explicitly with -fcolor-diagnostics, because when running through ccache, clang doesn't think it's printing to a terminal and turns off the color by default.
So a complete invocation might look like this:
./configure CC='ccache clang -Qunused-arguments -fcolor-diagnostics'
thanks mate. they look serious enough so I was scared to use ccache.
ReplyDeleteThanks!
ReplyDelete-The Internet
Another option is to set CCACHE_CPP2=1 in your environment, which disables the separate preprocessor and compile steps, running it more like your original command.
ReplyDeleteIs there a downside to doing that?
DeleteNot really. You might be interested in my follow-up article at http://peter.eisentraut.org/blog/2014/12/01/ccache-and-clang-part-3/
DeleteWorks for me - thanks!
ReplyDelete