microsoft / microsoft/vscode-cpptools
Code analysis should forward `-target` to clang
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace how compilerPath is passed through provideConfigurations and provideBrowseConfiguration into code analysis, then compare that path with raw compile_commands.json handling. Confirm that the target is forwarded to clang automatically for both sources, including the ARM Cortex M case, without requiring C_Cpp.codeAnalysis.clangTidy.args.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, typescript
- Domain
- compilers, embedded-iot, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100