microsoft / microsoft/vscode-cpptools

Code Analysis with useBuildPath=true gives 'stddef.h' file not found unless clangTidy.path is changed

Offen
#9,574 3 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug Feature: Code Analysis Language Service
Vorherrschende Sprache
TypeScript
Sterne
6.2k
Forks
1.7k
Ø Merge
14 Std. 46 Min.
Gemergte PRs (30 T.)
61

Beschreibung

If C_Cpp.codeAnalysis.clangTidy.useBuildPath is true then 'stddef.h' file not found may occur with the clang-tidy version that ships with our extension. The workaround is to set C_Cpp.codeAnalysis.clangTidy.path or possibly to launch VS Code with certain environment variables set (that works on Windows with the VS developer command prompt, but I'm not sure if there's a Linux/Mac equivalent). The problem is there is a particular clang system header include path that isn't being used. I don't know if there's a way to fix this via potentially some change to how we're building the clang-tidy binary or if we could manually locate/add the missing system include path header. I recall the missing path is something like /usr/lib/llvm-10/lib/clang/10.0.0/include -- when clang 10 is installed on the machine...it's possibly related to the fact that we build clang 14 and it's possible the issue may not repro if the matching version of the /usr/lib/llvm- is installed.

A user report is at https://github.com/microsoft/vscode-cpptools/issues/9555, but it got morphed into a bug on relative paths.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das Problem mit C_Cpp.codeAnalysis.clangTidy.useBuildPath=true und der mit der Erweiterung ausgelieferten clang-tidy-Version zu reproduzieren, und vergleiche dann deren System-Include-Pfade mit dem von einer passenden installierten LLVM-Version verwendeten Pfad. Erledigt ist die Aufgabe, wenn clang-tidy stddef.h finden kann, ohne clangTidy.path zu ändern oder auf eine plattformspezifische Entwicklungsumgebung angewiesen zu sein.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp
Bereich
compilers, tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
32/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.