Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!STROBL%DBNGMD21.BITNET@wiscvm.wisc.EDU From: STROBL%DBNGMD21.BITNET@wiscvm.wis (Wolfgang Strobl 49+228303223) Newsgroups: comp.lang.c Subject: Re: How (not) to Program in C (was Re: PD C as solution to binary Message-ID: <9057@brl-adm.ARPA> Date: Fri, 28-Aug-87 18:02:37 EDT Article-I.D.: brl-adm.9057 Posted: Fri Aug 28 18:02:37 1987 Date-Received: Sun, 30-Aug-87 04:05:45 EDT Sender: news@brl-adm.ARPA Lines: 15 > Unions -- are NEVER necessary. The only legal use of a union is to shrink a > variable which can contain a number of different types of values; a struct > will work just as well, at a (possibly large) space penalty. Illegal uses, You contradict yourself here - or did I miss the irony? On page 138 of K&R they say: "A union is a variable which may hold (at different times) objects of different types and sizes, with the compiler keeping track of size and alignment requirements. Unions provide a way to manipulate different kinds of data in a single area of storage, without embedding any machine-dependent information in the program." There is nothing more to say, I think. Wolfgang Strobl, STROBL@DBNGMD21.BITNET