Path: chuka.playstation.co.uk!news From: "pal" Newsgroups: scee.yaroze.freetalk.english Subject: Ten bytes bug in gcc? Date: 14 Aug 2001 11:09:02 GMT Organization: PlayStation Net Yaroze (SCEE) Lines: 23 Message-ID: <01c124b1$16cc8cc0$LocalHost@pal-s-omnibook> NNTP-Posting-Host: nas-cbv-6-10-2.dial.proxad.net X-Newsreader: Microsoft Internet News 4.70.1155 I came across the following weird thing. I think I remember seeing it mentionned on the ng, but I can't find back where. Here's the thing: the following program crashes. #include unsigned char test[10]; int main(){ printf("Ok.\n"); exit(0); } It seems to be related to the size of the array, as changing it can make the thing work. Adding another declaration (eg "unsigned char test2[2];") does not prevent the crash (I tried this because i suspected something to do with alignment). Does anybody understand this? note: compiled with gcc -Wall -Werror -W Test.c -O -Xlinker -Ttext -Xlinker 80090000 -o Test.pxe pal