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.
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.
Brief Issue Summary
When building for baremetal arm, clang-tidy shows warnings about
size_t
andunsigned long
compatibilty. It appears that clang-tidy thinks the target system is 64-bit like the build system, while it is actually 32-bit.c_cpp_verbose_output.txt
CMake Tools Diagnostics
Debug Log
Additional Information
The issue does not appear if set
"C_Cpp.codeAnalysis.clangTidy.useBuildPath": true
and manually add the compile commands location.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 byc_cpp_properties.json
.CMake toolchain file
arm-cortex-m4-gcc.txt