I am using ccache for experiments, but I am not quite sure that I should use this. Can anyone explain the situation when ccache can result in wrong behavior. Or should we always use ccache ? Anyone who got that ccache is producing wrong object files or changes in header files are not being considered ?
Share
I practically never have any issues while using
ccache. Sometimes (e.g. once a month or even less), I clean entirely its cache withccache -C.I have more issues with complex Makefile-s than with
ccache.To be short, don’t bother, and when you suspect something, just run
ccache -C.You obviously should avoid
ccachewhen you are benchmarking the compilation time. (You could pass-timeor-ftime-reporttogccorg++in that case).Addenda
I my opinion,
ccacheshould be at least configurable to disable caching for compilation using GCC plugins, because a GCC plugin could do anything (e.g. querying a database or webservice) which is not cachable. See this message.