Skip to content

X-Macro expansion false error. #14435

@Monsieur-Machine

Description

@Monsieur-Machine

Environment

  • OS and Version: Debian GNU/Linux 13 Trixie
  • VS Code Version: 1.119.0
  • C/C++ Extension Version: 1.32.2

Bug Summary and Steps to Reproduce

Bug Summary:
False error with X-Macros.

Steps to reproduce:

  1. Create a new C file colors.def for example with this content :
COLOR(RED)
COLOR(GREEN)
COLOR(BLUE)
  1. Create another C file like main.c with this content :
enum colors_t {
#define COLOR(NAME) NAME,
#include "colors.def"
#undef COLOR
};
  1. See the false error "expected an identifier" but compilation works perfectly.

Expected behavior:
No false error as the macro should expand and complete the enum.

Configuration and Logs

{
    "configurations": [
        {
            "name": "Default",
        }
    ],
    "version": 4
}

Other Extensions

Issue still persist after disabling any other extensions.

Additional context

This is not a fatal error since it is only visual but it is a problem in intellisense that shows up error even if there are not...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions