microsoft / microsoft/vscode-cpptools

Code analysis should forward `-target` to clang

Aperta
#11,749 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement Feature: Code Analysis Language Service more votes needed quick fix
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

Feature Request

I have a codebase for an ARM Cortex M target, in which I use the arm-none-eabi-gcc compiler. I'm using this extension in combination with another extension that uses the API to pass compile commands to the C/C++ extension. This extension passes the compilerPath in both its provideConfigurations and provideBrowseConfiguration hooks.

As far as I can tell, intellisense is able to pick up on this and treat types like size_t as a 32 bit unsigned integer. Code analysis, however does not do this on its own. I can work around this by passing my compiler to clang through the code analysis arguments:

"C_Cpp.codeAnalysis.clangTidy.args": [
  "--extra-arg=--target=arm-none-eabi-gcc"
],

Could the code analysis engine pick up -target from the compilerPath automatically? I assume the same applies to raw compile_commands.json too.

Related to, but separate from #9829.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Traccia il modo in cui compilerPath viene passato attraverso provideConfigurations e provideBrowseConfiguration all'analisi del codice, quindi confronta questo percorso con la gestione diretta di compile_commands.json. Conferma che il target viene inoltrato automaticamente a clang per entrambe le fonti, incluso il caso ARM Cortex M, senza richiedere C_Cpp.codeAnalysis.clangTidy.args.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp, typescript
Ambito
compilers, embedded-iot, tooling
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.