Path: utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice!sun-spots-request From: henry@zoo.toronto.edu (Henry Spencer) Newsgroups: comp.sys.sun Subject: Re: Union Problem on Sparc Keywords: Miscellaneous Message-ID: <337@brchh104.bnr.ca> Date: 20 Nov 90 18:00:01 GMT Sender: news@brchh104.bnr.ca Organization: Sun-Spots Lines: 13 Approved: Sun-Spots@rice.edu X-Original-Date: Mon, 5 Nov 90 16:49:06 GMT X-Refs: Original: v9n358 X-Sun-Spots-Digest: Volume 9, Issue 365, message 10 X-Note: Submissions: sun-spots@rice.edu, Admin: sun-spots-request@rice.edu In article <1990Nov4.031554.3208@rice.edu> brad@ds3.bradley.edu (Bradley E. Smith) writes: > union u x,z; > (void) doit(x,z); > (void) doit(0,0); Did you try running "lint" on this? You will find type mismatches. `0' is not a union value; it cannot be passed to a function that is expecting to get a union. On some machines this accidentally works, but on a lot of modern ones, it doesn't. There is no such thing as a "union constant" in C, so you'll have to assign `0' to a union variable and pass the variable. "I don't *want* to be normal!" | Henry Spencer at U of Toronto Zoology "Not to worry." | henry@zoo.toronto.edu utzoo!henry