Bug#419203: tcc: parses sizeof (x)[0] as (sizeof (x))[0]

2007-04-18 Thread Kalle Olavi Niemitalo
It is even possible to contrive programs where this bug does not cause compilation to fail but rather results in incorrect output. I think such constructs are very rare outside IOCCC, fortunately. #include #include int main (void) { static char x [2]; if (sizeof (*x) [x]) { puts (

Bug#419203: tcc: parses sizeof (x)[0] as (sizeof (x))[0]

2007-04-14 Thread Kalle Olavi Niemitalo
Package: tcc Version: 0.9.23-4.kon.1 Severity: normal gcc-4.0 4.0.3-3 compiles this program all right, but tcc fails: sizeof.c:5: pointer expected int main (void) { char x[1]; return (sizeof (x) [0]) - 1; } tcc 0.9.23-4.kon.1 is 0.9.23-4 + the patch from bug 418360. /* C99 6.5.3p1 */ unary-