Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!apple!darin From: darin@Apple.COM (Darin Adler) Newsgroups: comp.sys.mac.programmer Subject: Re: foo = *((bar *)stuff) Message-ID: <1507@internal.Apple.COM> Date: 24 Apr 89 00:31:07 GMT References: <713@tekno.chalmers.se> Organization: Apple Lines: 21 In article <713@tekno.chalmers.se> d83_sven_a@tekno.chalmers.se (Sven (Sciz) Axelsson) writes: > 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? Yes, the code should get the value contained at memory position 10. When I compiled the sequence of code with MPW C 3.0 it generated move.l $a,d7 This gets the value contained at memory position 10. x = 10 would generate moveq.l #$a,d7 instead. (Note the # means immediate mode.) -- Darin Adler, System Software Scapegoat, Apple Computer Internet: darin@Apple.com UUCP: {nsc,sun}!apple!darin