Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!bloom-beacon!athena.mit.edu!mlwiese From: mlwiese@athena.mit.edu (Michael L Wiese) Newsgroups: comp.sys.mac.programmer Subject: Problem w/ LSC 3.02 on SE/30 Message-ID: <12305@bloom-beacon.MIT.EDU> Date: 29 Jun 89 00:16:06 GMT Sender: daemon@bloom-beacon.MIT.EDU Reply-To: mlwiese@athena.mit.edu (Michael L Wiese) Distribution: usa Organization: Massachusetts Institute of Technology Lines: 46 I'm posting this for a friend; send replies to me though. The following C program runs fine on an SE, but refuses to execute the last line (the printf) on my SE/30. I have tried it with a bare System 6.0.3 to no avail. I'm using 3.01 upgraded to 3.02 with the patch available from sumex-aim.stanford.edu. I'm new to C and LSC; any help would be appreciated. #include #include typedef float TRANSFORM[4][4]; TRANSFORM *IDENT, *another; int alloc(amount) int amount; { char *temp; char *memptr; memptr = (char *) malloc(amount); printf("lvalue memptr = %u\n",&memptr); printf("rvalue memptr = %u\n",memptr); printf("rvalue *memptr = %d\n",*memptr); if(memptr == NULL) printf("Error: malloc fails\n"); else { temp = memptr; while(amount--) *temp++ = 0; } return((int)memptr); } main() { IDENT = (TRANSFORM *) alloc(sizeof (TRANSFORM)); another = (TRANSFORM *) alloc(sizeof (TRANSFORM)); (*IDENT)[2][2] = 3.1415; (*another)[2][2] = 1.234; printf("IDENT: %g another: %g\n",(*IDENT)[2][2],(*another)[2][2]); } Mike Wiese mlwiese@eagle.mit.edu