Skip to content

Code analysis should forward -target to clang #11749

@trond-snekvik

Description

@trond-snekvik

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature: Code AnalysisRelated to integration with clang-tidy, cppcheck, cl.exe /analyze, etc.Language ServiceenhancementImprovement to an existing featuremore votes neededIssues that have been postponed until more community members upvote itquick fix

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions