[clang] [Driver] -include: deprecate probing .gch (PR #67084)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 26 10:56:40 PDT 2023


MaskRay wrote:

> Reading the linked bugs, it's not clear that removing this would've helped all these issues all that much and it introduces a bunch of toil. So maybe we don't want to do this at all? But if we do, please put it behind a dedicated warning flag.

Clang PCH generation prefers `.pch` and the default extension name has been changed to use `.pch`. The inconvenience probing `.gch` happens when GCC and Clang `.pch` files are mismatched, which also happens with Clang tooling (language servers).

```
gcc -x c-header a.h
clang -include a.h -c a.c
```

Having a `-Wdeprecated-include-gch` looks good to me.

https://github.com/llvm/llvm-project/pull/67084


More information about the cfe-commits mailing list