On 2022-07-11 17:47:31 +0200, Domingo Alvarez Duarte wrote: > Although gcc compiles a file containing your example with warnings, I'm not > sure it's worth try to do the same in TiinyCC the preprocessor probably uses > TOKENS from the lexer to decide to skip till the end of the initial "#if 0" > and '"' is not a valid token the error probably come from the lexer that > found a non terminated string.
I agree that tcc should reject the code. It is too ambiguous to be regarded as an extension. GCC's interpretation is rather ugly. Consider a file "err.c": #define FOO bar " FOO " "FOO" zira:~> gcc -E err.c 2> /dev/null # 0 "err.c" # 0 "<built-in>" # 0 "<command-line>" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 0 "<command-line>" 2 # 1 "err.c" " bar " "FOO" while with tcc: zira:~> tcc -E err.c # 1 "err.c" # 1 "<command line>" 1 # 2 "err.c" 2 " FOO " "FOO" which makes more sense as an extension, IMHO. But tcc doesn't give any diagnostic there, and I think that this is incorrect. -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel