microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.52k stars 1.55k forks source link

cpptools does not respect freestanding environment #11837

Open enginelesscc opened 9 months ago

enginelesscc commented 9 months ago

Environment

Project is being managed through CMake with a custom toolchain using clang.exe for freestanding environment.

Bug Summary and Steps to Reproduce

Bug Summary:

Using intelliSenseMode windows-clang-x64, __STDC_HOSTED__ remains 1 despite -ffreestanding

Steps to reproduce:

  1. Add -ffreestanding to compilerArgs
  2. Set intelliSenseMode to windows-clang-x64 or clang-x64
  3. Include and open it
  4. Hover on #if __STDC_HOSTED__ and notice it is set to 1

Expected behavior:

__STDC_HOSTED__ is 0

Configuration and Logs

https://pastebin.com/9bhUN0jb (Too big for github)

Other Extensions

cmake tools v1.16.32

Additional context

Freestanding project. Efi program & standalone os kernel Using msabi-x64, clang Projects build and run fine, but intellisense is broken. Clangd works out of the box (compile_commands.json)

But even after setting "compileCommands": "${workspaceFolder}/.build/compile_commands.json", cpptools extensions dont work

CMakeToolchain.txt: https://pastebin.com/ngQxWhCB

browntarik commented 9 months ago

Thank you for submitting this bug, we have contacted our internal team to address it (VS: 1938471). For now, follow this issue to be informed of when the issue is fixed.