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: comp.lang.c Subject: Re: structure element offsets Message-ID: <7395@utzoo.UUCP> Date: Tue, 9-Dec-86 19:31:19 EST Article-I.D.: utzoo.7395 Posted: Tue Dec 9 19:31:19 1986 Date-Received: Tue, 9-Dec-86 19:31:19 EST References: <1096@spice.cs.cmu.edu> <7377@utzoo.UUCP>, <427@viper.UUCP> Organization: U of Toronto Zoology Lines: 29 Keywords: structure, offset > >Not modern C, which puts each structure's members in a separate name space. > > If so, most existing programs which use structures will not compile. Why not? Very few of them rely on the common name space. It's been bad practice to access one structure with another's member name all along. We converted from a common-name-space compiler to a separate-name-space compiler a little while ago. Very few things broke; the ones which did were generally doing obscene tricks with unions. The old V7 kernel was a problem area for that. > I haven't seen any compilers that insist on members-of-structures > being tied to a specific structure... Then you are using old compilers, or new compilers written from old definitions of C. Modern System V compilers, for example, all implement separate name spaces. I think the Berklix ones may have been fixed up to do likewise, although I'm not sure of that. > ... (What ever happened to > the days when a standards committee codified existing practises > rather than doing a re-engineering job?) I do have some complaints about X3J11 in this regard, but you are barking up the wrong tree this time. There is considerable experience with this particular practice, even if you aren't familiar with it. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,decvax,pyramid}!utzoo!henry