Obviously, having a compiler with the @ symbol will result in a syntax error (unless it is a comment or a string literal). However, if the character is found, for example. inside the #if 0 block, is the program technically?
I tried this:
#define NOTHING(x) int main() { NOTHING(@@@@); return 0; }
with -pedantic -Wall -Wextra , on both gcc and clang, and it did not give any warnings. I am not sure if this is guaranteed, or if they simply do not have a special warning.
I did not find anything in the standard, saying one way or another, which is disturbing. I donโt want to base the tool on this just to find out that a compiler compatible with the standard clamps it.
c c-preprocessor
mtijanic
source share