diff --git a/Project-Setup.md b/Project-Setup.md index ec8b69f..2756380 100644 --- a/Project-Setup.md +++ b/Project-Setup.md @@ -182,10 +182,13 @@ You may run into parsing errors like `unknown type name 'class'`. ### Compiler driver -The compiler driver (the first line unless `%compile_commands.json` is used) can usually just be `clang`. -`clang++` is usually unnecessary, and incorrect if some files are C. +Just use `clang` as the compiler driver (the first line unless `%compile_commands.json` is used). -Note that `clang a.cc` and `clang++ a.cc` are different, but the difference is only related to linking (what default runtime libraries are passed) and is not relevant for the frontend actions ccls performs. +* `clang` defaults to GCCMode (gcc). It correctly treats `.c` files as C and `.cpp` files as C++. +* `clang++` defaults to GXXMode (g++). It treats a `.c` file as C++ and issues a warning. + +`clang a.cc` and `clang++ a.cc` are different, but the difference is only related to linking (what default runtime libraries are passed) and is not relevant for the frontend actions ccls performs. +So for ccls use cases, just stick with `clang`. ## `.ccls` examples