tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] bug - pointer cast


From: Oded Shimon
Subject: [Tinycc-devel] bug - pointer cast
Date: Sat, 23 Jul 2005 09:30:31 +0300
User-agent: Mutt/1.5.9i

09:28) address@hidden:~ $ tcc -v
tcc version 0.9.23
09:29) address@hidden:~ $ cat -n a.c
     1  #include <inttypes.h>
     2  int main(void) {
     3          uint8_t * a, b[] = { 1, 1, 0, 0 };
     4          a = b;
     5          printf("%u\n", *((uint32_t *)&a[0]));
     6          printf("%u\n", *((uint32_t *)a));
     7          return 0;
     8  }
09:29) address@hidden:~ $ gcc a.c && ./a.out
257
257
09:29) address@hidden:~ $ tcc -run a.c
1
257

Took me FOREVER to find that this was why my tcc compilation of MPlayer was 
misbehaving...

- ods15




reply via email to

[Prev in Thread] Current Thread [Next in Thread]