You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
C and CUDA files in compile_commands.json are misinterpreted as C++ files #13471
While editing a .c file, vscode shows this warning for the code uint8_t *ptr = malloc(size):
a value of type "void *" cannot be assigned to an entity of type "uint8_t *" (aka "unsigned char *")C/C++(513)
I believe that's a C++ warning that should not happen in a C program.
I have a compile_commands.json that does provide the compile command for that specific file and it produces no warning. The command starts with ccache cc ... with cc symlink to /usr/bin/gcc.
Hi Xavier Claessens (@xclaesse) . Thanks for reporting this. It looks like 1.24.5 has a regression related to C and CUDA source files in compile_commands.json being interpreted as C++. We have a fix in progress that should go into our next prerelease.
Activity
Colengms commentedon Apr 8, 2025
Hi Xavier Claessens (@xclaesse) . Thanks for reporting this. It looks like 1.24.5 has a regression related to C and CUDA source files in
compile_commands.jsonbeing interpreted as C++. We have a fix in progress that should go into our next prerelease.[-]C++ warnings shown in C file[/-][+]C and CUDA files in `compile_commands.json` are misinterpreted as C++ files[/+]sywe1 commentedon Apr 10, 2025
Are there any workarounds? My workspace is populated with error squiggles. Many thanks for considering my request.
sean-mcmanus commentedon Apr 11, 2025
sywe1 The fix is available with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.25.0 . I'm not sure if there's a workaround.
xclaesse commentedon Apr 11, 2025
I can confirm my issue is fixed with cpptools pre-release. Thanks!