Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c Subject: Re: making it easier to use unions Message-ID: <6918@utzoo.UUCP> Date: Thu, 10-Jul-86 13:43:53 EDT Article-I.D.: utzoo.6918 Posted: Thu Jul 10 13:43:53 1986 Date-Received: Thu, 10-Jul-86 13:43:53 EDT References: <1725@brl-smoke.ARPA>, <19600002@uicsrd> Organization: U of Toronto Zoology Lines: 12 > C++ permits "anonymous unions" ... Actually, the really old C compilers permitted this too, by accident, since they had no notion that a struct/union member name "belonged" to a particular struct/union. To them, a member name was just an offset and a type. Since all offsets in a union are 0, it all worked out. A certain amount of old code, notably the Unix kernel, relied on this. This trick broke when member names became local. -- Usenet(n): AT&T scheme to earn revenue from otherwise-unused Henry Spencer @ U of Toronto Zoology late-night phone capacity. {allegra,ihnp4,decvax,pyramid}!utzoo!henry