microsoft / microsoft/vscode-cpptools
X-Macro expansion false error.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
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:
- Create a new C file colors.def for example with this content :
COLOR(RED)
COLOR(GREEN)
COLOR(BLUE)
- Create another C file like main.c with this content :
enum colors_t {
#define COLOR(NAME) NAME,
#include "colors.def"
#undef COLOR
};
- 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...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the diagnostic with the two files named in the report, colors.def and main.c, using the shown X-macro pattern. Trace how IntelliSense parses the included macro expansion and identify why it reports “expected an identifier”; done means the false diagnostic disappears while the example continues to compile successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100