structure element offsets

Henry Spencer henry at utzoo.UUCP
Wed Dec 10 10:31:19 AEST 1986


>  >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



More information about the Comp.lang.c mailing list