microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.45k stars 442 forks source link

Clang-tidy uses incorrect integer sizes when cross-compiling for baremetal arm #3061

Open glennvl opened 1 year ago

glennvl commented 1 year ago

Brief Issue Summary

When building for baremetal arm, clang-tidy shows warnings about size_t and unsigned long compatibilty. It appears that clang-tidy thinks the target system is 64-bit like the build system, while it is actually 32-bit.

image

c_cpp_verbose_output.txt

CMake Tools Diagnostics

{
  "os": "linux",
  "vscodeVersion": "1.76.2",
  "cmtVersion": "1.13.45",
  "configurations": [
    {
      "folder": "/home/glenn/projects/STM32F303-DISCOVERY",
      "cmakeVersion": "3.25.2",
      "configured": true,
      "generator": "Ninja",
      "usesPresets": true,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug"
    ],
    "requests": [
      "file:///home/glenn/projects/STM32F303-DISCOVERY/src/disable_heap.cpp"
    ],
    "responses": [
      {
        "uri": "file:///home/glenn/projects/STM32F303-DISCOVERY/src/disable_heap.cpp",
        "configuration": {
          "includePath": [
            "/home/glenn/projects/STM32F303-DISCOVERY/src/util/include",
            "/home/glenn/projects/STM32F303-DISCOVERY/src/hal/include",
            "/home/glenn/.conan2/p/ms-gs55a01613f4354/p/include",
            "/usr/share/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/arm-none-eabi/include/c++/12.2.1",
            "/usr/share/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/arm-none-eabi/include/c++/12.2.1/arm-none-eabi/thumb/v7e-m+fp/hard",
            "/usr/share/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/arm-none-eabi/include/c++/12.2.1/backward",
            "/usr/share/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/12.2.1/include",
            "/usr/share/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/12.2.1/include-fixed",
            "/usr/share/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/arm-none-eabi/include"
          ],
          "defines": [],
          "compilerPath": "/usr/share/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-g++",
          "compilerArgs": [
            "--sysroot=/usr/share/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi"
          ],
          "compilerFragments": [
            "-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -Og -g3",
            "-Wall",
            "-Wextra",
            "-Wpedantic",
            "-Wshadow",
            "-Wconversion",
            "-Wsign-conversion",
            "-Wdouble-promotion",
            "-Wextra-semi",
            "-Wnon-virtual-dtor",
            "-Wold-style-cast",
            "-Wcast-align",
            "-Wunused",
            "-Woverloaded-virtual",
            "-Wnull-dereference",
            "-Wimplicit-fallthrough",
            "-Wformat=2",
            "-Werror",
            "-Wmisleading-indentation",
            "-Wduplicated-cond",
            "-Wduplicated-branches",
            "-Wlogical-op",
            "-Wuseless-cast",
            "-fdiagnostics-color=always",
            "-fno-exceptions",
            "-fno-unwind-tables",
            "-fno-rtti",
            "-fno-threadsafe-statics",
            "-std=c++20"
          ]
        }
      }
    ],
    "partialMatches": [],
    "targetCount": 3,
    "executablesCount": 1,
    "librariesCount": 0,
    "targets": [
      {
        "name": "doxygen-docs",
        "type": "UTILITY"
      },
      {
        "name": "stm32f303demo",
        "type": "EXECUTABLE"
      },
      {
        "name": "stm32f303demo.bin",
        "type": "UTILITY"
      }
    ]
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

Debug Log

[main] Building folder: STM32F303-DISCOVERY clean
[main] Saving open files before configure/build
[build] Starting build
[driver] Start build clean
[proc] Executing command: /usr/bin/cmake --build /home/glenn/projects/STM32F303-DISCOVERY/build/armv7hf-baremetal-gcc-debug --target clean
[proc]   with environment: {"USER":"glenn","VSCODE_WSL_EXT_LOCATION":"/mnt/c/Users/Glenn/.vscode/extensions/ms-vscode-remote.remote-wsl-0.76.1","SHLVL":"1","WT_PROFILE_ID":"{2c4de342-38b7-51cf-b940-2309a097f518}","HOME":"/home/glenn","WSL_DISTRO_NAME":"Ubuntu","WAYLAND_DISPLAY":"wayland-0","LOGNAME":"glenn","NAME":"Code","WSL_INTEROP":"/run/WSL/162_interop","PULSE_SERVER":"unix:/mnt/wslg/PulseServer","_":"/mnt/c/Users/Glenn/AppData/Local/Programs/Microsoft VS Code/bin/code","TERM":"xterm-256color","PATH":"/home/glenn/.vscode-server/bin/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/bin/remote-cli:/home/glenn/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/iCLS/:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/iCLS/:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/Program Files/MiKTeX 2.9/miktex/bin/x64/:/mnt/c/Program Files (x86)/Skype/Phone/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/TortoiseGit/bin:/mnt/c/Program Files/usbipd-win/:/mnt/c/Program Files/Cppcheck:/Docker/host/bin:/mnt/c/Users/Glenn/.cargo/bin:/mnt/c/Users/Glenn/AppData/Local/Programs/Python/Python310/Scripts/:/mnt/c/Users/Glenn/AppData/Local/Programs/Python/Python310/:/mnt/c/Users/Glenn/AppData/Local/Programs/Python/Python39/Scripts/:/mnt/c/Users/Glenn/AppData/Local/Programs/Python/Python39/:/mnt/c/Users/Glenn/AppData/Local/Programs/Python/Python38/Scripts/:/mnt/c/Users/Glenn/AppData/Local/Programs/Python/Python38/:/mnt/c/Users/Glenn/AppData/Local/Programs/Python/Python37/Scripts/:/mnt/c/Users/Glenn/AppData/Local/Programs/Python/Python37/:/mnt/c/Users/Glenn/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/Glenn/AppData/Roaming/MiKTeX/2.9/miktex/bin/x64/:/mnt/c/Users/Glenn/AppData/Local/Programs/Microsoft VS Code/bin:/snap/bin","WT_SESSION":"6cdc445e-7827-407f-a7ce-64cb758b5238","XDG_RUNTIME_DIR":"/mnt/wslg/runtime-dir","DISPLAY":":0","LANG":"C.UTF-8","SHELL":"/bin/bash","VSCODE_SERVER_TAR":"/mnt/c/Users/Glenn/AppData/Local/Temp/vscode-remote-wsl/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/vscode-server-stable-linux-x64.tar.gz","PWD":"/mnt/c/Users/Glenn/AppData/Local/Programs/Microsoft VS Code","WSL2_GUI_APPS_ENABLED":"1","HOSTTYPE":"x86_64","WSLENV":"ELECTRON_RUN_AS_NODE/w:WT_SESSION::WT_PROFILE_ID\n","VSCODE_HANDLES_SIGPIPE":"true","LS_COLORS":"rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:","LESSCLOSE":"/usr/bin/lesspipe %s %s","LESSOPEN":"| /usr/bin/lesspipe %s","XDG_DATA_DIRS":"/usr/local/share:/usr/share:/var/lib/snapd/desktop","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_NLS_CONFIG":"{\"locale\":\"en\",\"availableLanguages\":{}}","MOTD_SHOWN":"update-motd","VSCODE_CWD":"/mnt/c/Users/Glenn/AppData/Local/Programs/Microsoft VS Code","ELECTRON_RUN_AS_NODE":"1","VSCODE_IPC_HOOK_CLI":"/mnt/wslg/runtime-dir/vscode-ipc-62151fb0-3db7-4e2f-88ae-7dcbda75adf5.sock","VSCODE_L10N_BUNDLE_LOCATION":""}
[build] [0/1] Re-running CMake...
[build] -- Using Conan toolchain: /home/glenn/projects/STM32F303-DISCOVERY/build/armv7hf-baremetal-gcc-debug/generators/conan_toolchain.cmake
[build] -- Conan toolchain: C++ Standard 20 with extensions OFF
[build] -- Using compiler GNU
[build] -- Using custom compiler cache system: 'cache', explicitly supported entries are ccache;sccache
[build] -- /usr/bin/ccache found and enabled
[build] -- Adding `doxygen-docs` target that builds the documentation
[build] -- Conan: Component target declared 'ms-gsl::_ms-gsl'
[build] -- Conan: Target declared 'Microsoft.GSL::GSL'
[build] -- Configuring done
[build] -- Generating done
[build] -- Build files have been written to: /home/glenn/projects/STM32F303-DISCOVERY/build/armv7hf-baremetal-gcc-debug
[build] [1/2] Cleaning additional files...
[build] [2/2] Cleaning all built files...
[build] Cleaning... 5 files.
[cmakefileapi-parser] Read reply folder: /home/glenn/projects/STM32F303-DISCOVERY/build/armv7hf-baremetal-gcc-debug/.cmake/api/v1/reply
[cmakefileapi-parser] Found index files: ["cache-v2-3c685fad5c344c982eb1.json","cmakeFiles-v1-ca49335110cf20862802.json","codemodel-v2-82e38ad0fbd1e158724f.json","directory-.-Debug-f5ebdc15457944623624.json","directory-src-Debug-b6cf2213fc5053b67c22.json","directory-src.hal-Debug-15e4a48a7dd138b6b5a1.json","directory-src.util-Debug-86cf09791d51c42f0db6.json","index-2023-03-15T19-27-21-0977.json","target-doxygen-docs-Debug-7ef21cd67d98abf370fb.json","target-stm32f303demo-Debug-1b807b9cd98d13d1e502.json","target-stm32f303demo.bin-Debug-69f68216ea26f93e02bd.json","toolchains-v1-69a4bbbe10870f74b108.json"]
[cache] Reading CMake cache file /home/glenn/projects/STM32F303-DISCOVERY/build/armv7hf-baremetal-gcc-debug/CMakeCache.txt
[cache] Parsing CMake cache string
[build] Build finished with exit code 0
[main] Building folder: STM32F303-DISCOVERY 
[main] Saving open files before configure/build
[build] Starting build
[driver] Start build all
[proc] Executing command: /usr/bin/cmake --build /home/glenn/projects/STM32F303-DISCOVERY/build/armv7hf-baremetal-gcc-debug --target all
[proc]   with environment: {"USER":"glenn","VSCODE_WSL_EXT_LOCATION":"/mnt/c/Users/Glenn/.vscode/extensions/ms-vscode-remote.remote-wsl-0.76.1","SHLVL":"1","WT_PROFILE_ID":"{2c4de342-38b7-51cf-b940-2309a097f518}","HOME":"/home/glenn","WSL_DISTRO_NAME":"Ubuntu","WAYLAND_DISPLAY":"wayland-0","LOGNAME":"glenn","NAME":"Code","WSL_INTEROP":"/run/WSL/162_interop","PULSE_SERVER":"unix:/mnt/wslg/PulseServer","_":"/mnt/c/Users/Glenn/AppData/Local/Programs/Microsoft VS Code/bin/code","TERM":"xterm-256color","PATH":"/home/glenn/.vscode-server/bin/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/bin/remote-cli:/home/glenn/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/iCLS/:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/iCLS/:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/Program Files/MiKTeX 2.9/miktex/bin/x64/:/mnt/c/Program Files (x86)/Skype/Phone/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/TortoiseGit/bin:/mnt/c/Program Files/usbipd-win/:/mnt/c/Program Files/Cppcheck:/Docker/host/bin:/mnt/c/Users/Glenn/.cargo/bin:/mnt/c/Users/Glenn/AppData/Local/Programs/Python/Python310/Scripts/:/mnt/c/Users/Glenn/AppData/Local/Programs/Python/Python310/:/mnt/c/Users/Glenn/AppData/Local/Programs/Python/Python39/Scripts/:/mnt/c/Users/Glenn/AppData/Local/Programs/Python/Python39/:/mnt/c/Users/Glenn/AppData/Local/Programs/Python/Python38/Scripts/:/mnt/c/Users/Glenn/AppData/Local/Programs/Python/Python38/:/mnt/c/Users/Glenn/AppData/Local/Programs/Python/Python37/Scripts/:/mnt/c/Users/Glenn/AppData/Local/Programs/Python/Python37/:/mnt/c/Users/Glenn/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/Glenn/AppData/Roaming/MiKTeX/2.9/miktex/bin/x64/:/mnt/c/Users/Glenn/AppData/Local/Programs/Microsoft VS Code/bin:/snap/bin","WT_SESSION":"6cdc445e-7827-407f-a7ce-64cb758b5238","XDG_RUNTIME_DIR":"/mnt/wslg/runtime-dir","DISPLAY":":0","LANG":"C.UTF-8","SHELL":"/bin/bash","VSCODE_SERVER_TAR":"/mnt/c/Users/Glenn/AppData/Local/Temp/vscode-remote-wsl/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/vscode-server-stable-linux-x64.tar.gz","PWD":"/mnt/c/Users/Glenn/AppData/Local/Programs/Microsoft VS Code","WSL2_GUI_APPS_ENABLED":"1","HOSTTYPE":"x86_64","WSLENV":"ELECTRON_RUN_AS_NODE/w:WT_SESSION::WT_PROFILE_ID\n","VSCODE_HANDLES_SIGPIPE":"true","LS_COLORS":"rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:","LESSCLOSE":"/usr/bin/lesspipe %s %s","LESSOPEN":"| /usr/bin/lesspipe %s","XDG_DATA_DIRS":"/usr/local/share:/usr/share:/var/lib/snapd/desktop","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_NLS_CONFIG":"{\"locale\":\"en\",\"availableLanguages\":{}}","MOTD_SHOWN":"update-motd","VSCODE_CWD":"/mnt/c/Users/Glenn/AppData/Local/Programs/Microsoft VS Code","ELECTRON_RUN_AS_NODE":"1","VSCODE_IPC_HOOK_CLI":"/mnt/wslg/runtime-dir/vscode-ipc-62151fb0-3db7-4e2f-88ae-7dcbda75adf5.sock","VSCODE_L10N_BUNDLE_LOCATION":""}
[build] [1/7] Building CXX object src/CMakeFiles/stm32f303demo.dir/stdlib.cpp.obj
[build] Checking /home/glenn/projects/STM32F303-DISCOVERY/src/stdlib.cpp ...
[build] [2/7] Building CXX object src/CMakeFiles/stm32f303demo.dir/disable_heap.cpp.obj
[build] Checking /home/glenn/projects/STM32F303-DISCOVERY/src/disable_heap.cpp ...
[build] [3/7] Generating documentation - entry file: /home/glenn/projects/STM32F303-DISCOVERY/build/armv7hf-baremetal-gcc-debug/html/index.html
[build] [4/7] Building CXX object src/CMakeFiles/stm32f303demo.dir/startup_stm32f303vc.cpp.obj
[build] Checking /home/glenn/projects/STM32F303-DISCOVERY/src/startup_stm32f303vc.cpp ...
[build] [5/7] Building CXX object src/CMakeFiles/stm32f303demo.dir/main.cpp.obj
[build] Checking /home/glenn/projects/STM32F303-DISCOVERY/src/main.cpp ...
[build] [6/7] Linking CXX executable src/stm32f303demo.elf
[build] Memory region         Used Size  Region Size  %age Used
[build]            flash:        1452 B       256 KB      0.55%
[build]             sram:          88 B        40 KB      0.21%
[build]            ccram:          0 GB         8 KB      0.00%
[build] [7/7] cd /home/glenn/projects/STM32F303-DISCOVERY/build/armv7hf-baremetal-gcc-debug/src && /usr/share/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-objcopy -Obinary stm32f303demo.elf stm32f303demo.bin && /usr/share/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-objcopy -Oihex stm32f303demo.elf stm32f303demo.hex
[cmakefileapi-parser] Read reply folder: /home/glenn/projects/STM32F303-DISCOVERY/build/armv7hf-baremetal-gcc-debug/.cmake/api/v1/reply
[cmakefileapi-parser] Found index files: ["cache-v2-3c685fad5c344c982eb1.json","cmakeFiles-v1-ca49335110cf20862802.json","codemodel-v2-82e38ad0fbd1e158724f.json","directory-.-Debug-f5ebdc15457944623624.json","directory-src-Debug-b6cf2213fc5053b67c22.json","directory-src.hal-Debug-15e4a48a7dd138b6b5a1.json","directory-src.util-Debug-86cf09791d51c42f0db6.json","index-2023-03-15T19-27-21-0977.json","target-doxygen-docs-Debug-7ef21cd67d98abf370fb.json","target-stm32f303demo-Debug-1b807b9cd98d13d1e502.json","target-stm32f303demo.bin-Debug-69f68216ea26f93e02bd.json","toolchains-v1-69a4bbbe10870f74b108.json"]
[cache] Reading CMake cache file /home/glenn/projects/STM32F303-DISCOVERY/build/armv7hf-baremetal-gcc-debug/CMakeCache.txt
[cache] Parsing CMake cache string
[build] Build finished with exit code 0
[extension] [9449] cmake.cleanRebuild finished (returned 0)

Additional Information

The issue does not appear if set "C_Cpp.codeAnalysis.clangTidy.useBuildPath": true and manually add the compile commands location.

    "configurations": [
        {
            "name": "cmake",
            "compileCommands": "${workspaceFolder}/build/armv7hf-baremetal-gcc-debug/compile_commands.json",
            "configurationProvider": "ms-vscode.cmake-tools"
        }
    ],
    "version": 4

But the problem with this workaround is that the compile commands location depends on the cmake preset. So compileCommands would become ${command:cmake.buildDirectory}/compile_commands.json, which is not supported by c_cpp_properties.json.

CMake toolchain file

arm-cortex-m4-gcc.txt

gcampbell-msft commented 1 year ago

Thank you for reporting this issue. We will take a look into it.