Try the following:
/* */ #include <stdio.h>
or
/*
*/ #include <stdio.h>
The directive #include will not be highlighted.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Is that actually valid syntax?
Yes. According to section 5.1.1.2 of the C standard, comments are replaced by a space character before #include preprocessing directives are interpreted. Also, tested with GCC, just in case.
What you probably had in mind was something along the lines of:
#define EMPTY
EMPTY #include <stdio.h>
where #include is indeed not a preprocessing directive because EMPTY will not have been replaced at the end of the 4th translation phase, as defined in the specification. This already works as expected.
Not all valid syntax can be recognized. The highlighting is pattern based, it is not a full parser.
This construct is unusual enough that we don't need to support it.
I would discourage writing it like that anyway, better put the comment above the #include.
Closed #5705.