Those macros are compiled without error with visual studio and codewarrior compilers. With gcc the error is shown in the comment
#define STRINGIFY(x) #x
#define MYINC(n) STRINGIFY(extensions/##n##/myinc.h)
#include "extensions/1/myinc.h" // OK (no surprise)
#include STRINGIFY(extensions/1/myinc.h) // OK
#include MYINC(1) // error: pasting "1" and "/" does not give a valid preprocessing token
Some idea?
Actually On my environment (WSL2 gcc9.3), the line
event triger compiling error
From GCC document https://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html I found this:
And MSVC-170 document https://learn.microsoft.com/en-us/cpp/preprocessor/hash-include-directive-c-cpp?view=msvc-170 says:
So I guess the problem is some gcc won't expand macro. But if I define:
GCC didn't report error. And If I write:
GCC also reports: