The documentation has an incorrect example of PCH files usage via -include option. The possibility has not been available since llvm-svn: 174385.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Reopening for further discussion or clarification.
The changes appear to suggest that a PCH file won't be implicitly used when an explicit include for the corresponding header is made via the -include option, but that is not correct.
$ cat t.h const int i = 0; $ cat t.c int g = i; $ clang t.h $ ls -1 t.c t.h t.h.gch $ clang -c -I. -include t.h t.c $ touch t.h $ clang -c -I. -include t.h t.c fatal error: file '/iusers/thonerma/tmp/pch/t.h' has been modified since the precompiled header 't.h.gch' was built: mtime changed note: please rebuild precompiled header 't.h.gch' 1 error generated.
If the ability to include a PCH file via -include is intentional behavior (as I have always believed it to be), then I think the documentation should demonstrate both the -include and -include-pch methods of using a PCH file.
Please note that gcc also supports implicit use of a PCH file via its -include option.
Comment Actions
Re-closing since this review has already landed.
@akyrtzi, did you see my last comment? If I don't hear back from you, I'll submit a new doc change that covers both forms of PCH use.