Skip to content

C and CUDA files in compile_commands.json are misinterpreted as C++ files #13471

@xclaesse

Description

@xclaesse

Environment

  • OS and Version: Ubuntu 24.04
  • VS Code Version: 1.99.0
  • C/C++ Extension Version: 1.24.5

Bug Summary and Steps to Reproduce

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.

Other Extensions

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

Feature: Compile CommandsLanguage ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.regressionA bug that didn't exist in a previous release

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions