Clang Kit scanning will accidentally use GCC for C++
See original GitHub issueBrief Issue Summary
The Clang kit scan is broken with current LLVM 11. It will show as

and then call CMake with only the CMAKE_C_COMPILER set. This leads to the mixing of GCC and Clang toolchains

This is very subtle and causes a lot of confusion.
Expected:
- Kits without a C++ compiler should not show if the project is C++. Or such kits should have a different style to warn users.
- LLVM 11.1 Kits should be properly detected
CMake Tools Log
[kit] Found Kit: GCC for aarch64-linux-gnu 10.2.0
[kit] Found Kit: GCC for aarch64-linux-gnu 10.2.0
[kit] Found Kit: GCC for arm-none-eabi 10.2.0
[kit] Found Kit: GCC for arm-none-eabi 10.2.0
[kit] Found Kit: Clang 11.1.0
[kit] Found Kit: Clang 11.1.0
[kit] Found Kit: GCC 10.2.0
[kit] Found Kit: GCC 7.4.1
[kit] Found Kit: GCC 8.4.0
[kit] Found Kit: GCC 9.3.0
[kit] Found Kit: GCC for riscv64-linux-gnu 10.2.0
[kit] Found Kit: GCC for riscv64-linux-gnu 10.2.0
[kit] Found Kit: GCC for riscv64-unknown-elf 8.2.0
[kit] Found Kit: GCC for riscv64-unknown-elf 8.2.0
[kit] Found Kit: GCC for x86_64-pc-linux-gnu 10.2.0
[kit] Found Kit: GCC for x86_64-pc-linux-gnu 10.2.0
[kit] Found Kit: GCC for x86_64-pc-linux-gnu 7.4.1
[kit] Found Kit: GCC for x86_64-pc-linux-gnu 7.4.1
[kit] Found Kit: GCC for x86_64-pc-linux-gnu 8.4.0
[kit] Found Kit: GCC for x86_64-pc-linux-gnu 8.4.0
[kit] Found Kit: GCC for x86_64-pc-linux-gnu 9.3.0
[kit] Found Kit: GCC for x86_64-pc-linux-gnu 9.3.0
[kit] Found Kit: GCC 10.2.0
[kit] Successfully loaded 15 kits from /home/fan/.local/share/CMakeTools/cmake-tools-kits.json
Platform and Versions
- Operating System: Arch Linux
- CMake Version: 3.20.1
- VSCode Version: 1.55.1
- CMake Tools Extension Version: 1.6.0
- Compiler/Toolchain: LLVM 11.1
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:23 (10 by maintainers)
Top Results From Across the Web
GCC not recognized anymore · Issue #1821
loggingLevel to debug permitted me to see GCC is not recognized (sorry output ... Clang Kit scanning will accidentally use GCC for C++...
Read more >GCC or Clang : r/C_Programming
You need both. Clang has much more features, less bugs and better warnings. GCC is the standard.
Read more >The Best and Worst GCC Compiler Flags For Embedded
In this article we will explore some of the best and worst compiler flags for GCC (and Clang). Our focus will be on...
Read more >Language Compatibility - Clang - LLVM
In general, Clang is highly compatible with the GCC inline assembly extensions, allowing the same set of constraints, modifiers and operands as GCC...
Read more >3.13 Options Controlling the Preprocessor
These options control the C preprocessor, which is run on each C source file before actual compilation. If you use the -E option,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Unfortunately, the logging for the kits scanning feature is not very useful. We will improve it and once the change is merged in the code base we will create a vsix for you to reproduce this issue again and send us better logs. Until then, you can complete your kit definition with the CXX compiler and make sure you don’t scan again (it will overwrite your edit). Let us know if you encounter any issues with fixing the kit definition directly in the kits file.
Can confirm identical behaviour with VS Code 1.55.2, CMake Tools 1.7.1, and similar LLVM & CMake version on Arch Linux.