The following crashes tcc 0.9.26 :
/**************************/
typedef struct X { int len; } X;
#define init(s,len) s.len = len;
int main(void) {
X myX;
init(myX,10);
return 0;
}
/**************************/
Of course, the macro is wrong, because it uses the same field name of the struct
as a placeholder id, hence the statement in main turns into
myX.10 = 10 ;
instead of
myX.len = 10 ;
as desired.
The issue, of course, is that the compiler should not crash.
gcc (3.4.5 in mingw) outputs: "error: syntax error before numeric constant"
Strangely, if I directly writes "myX.10 = 10 ;" in the main body, tcc does not crash,
but the error message is quite strange:
" error: ';' expected (got "└")"