Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: "Brian Weed" Newsgroups: scea.yaroze.programming.gnu_compiler Subject: Does this work with GCC? Date: Thu, 28 Oct 1999 12:23:55 -0400 Organization: SCEA News Server Lines: 34 Message-ID: <7vaa1h$bhb1@scea> NNTP-Posting-Host: mail.vipah.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Can someone test this function for me with a GCC built project? It crashes when I run this function in a CodeWarrior built project. void TestBug(void) { union { char *p8; unsigned short *p16; } u; char *pBuf; unsigned short n; int i; if ((pBuf = (char *)malloc(40)) != NULL) { u.p8 = pBuf; for (i = 0; i < 38; i++) { n = *u.p16; // Crashes when p16 is odd u.p8++; } free(pBuf); } } Thanks... Brian Weed bweed@vipah.com