Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!rutgers!att!pegasus!ech From: ech@pegasus.ATT.COM (Edward C Horvath) Newsgroups: comp.sys.mac.programmer Subject: Re: foo = *((bar *)stuff) Message-ID: <2822@pegasus.ATT.COM> Date: 24 Apr 89 19:14:19 GMT References: <713@tekno.chalmers.se> Organization: AT&T ISL Middletown NJ USA Lines: 32 From article <713@tekno.chalmers.se>, by d83_sven_a@tekno.chalmers.se (Sven (Sciz) Axelsson): > Am I really out of line, or is this a true-to-God bug in the final release > of MPW C 3.0?? Isn't this code supposed to assign the integer value contained > at memory position 10 to the variable x? > x = *((int *)10); > In MPW C 3.0 this generates exactly the same code as would x = 10. > Am I right or am I right? If you were right, then yes, perhaps you're right. But I fed MPW C 3.0 the following: int x,y; foo() { x = 10; y = *((int *) 10); } I then ran dumpobj on the resulting .c.o; it reported, in part, LINK A6,#$0000 MOVEQ #$0A,D0 MOVE.L D0,x ; id: 4 MOVE.L $000A,y ; id: 3 UNLK A6 RTS which looks fine to me. Efficient, no; correct, yes. =Ned Horvath=