ccache false cache hit when creating precompiled headers

"Mark Fieldhouse" <[email protected]> Mon, 4 Aug 2014 21:09:08 +0100
Newsgroups gmane.comp.compilers.ccache
Message-ID <F3D4932445884BEABEF9515FADF99440@MGF5>
Hello,
 
ccache appears to break our compilation by incorrectly retrieving cached
precompiled headers.
 
The problem is our build has a header file which has;
 
#define NUM_COMPOSITE_OUTPUTS 0
void func(int x);
 
This gets compiled and put in the cache by ccache.
We then change the file to be;
 
#define NUM_COMPOSITE_OUTPUTS 2
void func(int x);
 
And ccache runs its own 'direct' hash function and correctly decides
that the file is not in the cache.
Then it runs the C pre-processor and hashes the output.
 
The output of the C pre-processor hasn't changed so ccache incorrectly
retrieves the cached version of the file
Which has;
#define NUM_COMPOSITE_OUTPUTS 0
 
Failed build.
 
Let me know if this is a known issue or if you'd like me to raise a bug
report?
 
Cheers,
Mark