Union Wierdness on Sparc C Compiler
Wm. Scott `Spot' Draves
wsd at cs.brown.edu
Fri Jun 8 10:51:32 AEST 1990
In article <8618 at brazos.Rice.edu> kemnitz at 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 at cs.brown.edu
uunet!brunix!wsd
More information about the Comp.sys.sun
mailing list