Compiler version vs precompile header

Hi,

I am trying to write a Python script that would check whether an existing precompiled header is compatible with clang (I use SCons as a build system and I would like to make that check to ensure the compilation will not fail later). Do the bytes following CPCH at the beginning of the precompile header carry some meaning e.g.?

Thanks,

Luc Bourhis

Hello

I am trying to write a Python script that would check whether an existing precompiled header is compatible with clang (I use SCons as a build system and I would like to make that check to ensure the compilation will not fail later). Do the bytes following CPCH at the beginning of the precompile header carry some meaning e.g.?

Have you read http://clang.llvm.org/docs/PCHInternals.html and around?

Yes but it looked to me that I would need to program against the llvm
libraries to do the proper way. Using the clang Python bindings would
be the only option. I get them if I install a clang official release
but not if I use what comes with Xcode. Or am I mistaken?

Actually, I had missed the mention of llvm-bcanalyzer: llvm-bcanalyzer
-dump shows me a section VERSION_CONTROL_BRANCH_REVISION. It looks
like comparing the compiler version against the info of that section
does the trick. Is that a correct approach?

Thanks,

Luc Bourhis