Path: utzoo!attcan!uunet!aplcen!samsung!cs.utexas.edu!rice!sun-spots-request From: wsd@cs.brown.edu (Wm. Scott `Spot' Draves) Newsgroups: comp.sys.sun Subject: Re: Union Wierdness on Sparc C Compiler Keywords: Software Message-ID: <8666@brazos.Rice.edu> Date: 8 Jun 90 00:51:32 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 19 Approved: Sun-Spots@rice.edu X-Refs: Original: v9n201 X-Sun-Spots-Digest: Volume 9, Issue 201, message 12 In article <8618@brazos.Rice.edu> kemnitz@postgres.berkeley.edu (Greg Kemnitz) writes: I am not sure if this is a *bug*, but it sure behaves strangely... If you compile the following program on a Sparcstation or Sun 4, you will get foo: a is -14249818 (or something similar). If you compile it on practically anything else, (ie, DECstation, Sun 3, Sequent, Vax) you get foo: a is 22 This is because unions are passed by reference (pointer). The program is, of course, to blame. try linting it, then shoot the authors of that 170k line program. Scott Draves Space... The Final Frontier wsd@cs.brown.edu uunet!brunix!wsd