Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 beta 3/9/83; site desint.UUCP
Path: utzoo!watmath!clyde!bonnie!akgua!sdcsvax!sdcrdcf!trwrb!desint!geoff
From: geoff@desint.UUCP (Geoff Kuenning)
Newsgroups: net.lang.c
Subject: Re: Re: offsets in structures.
Message-ID: <157@desint.UUCP>
Date: Mon, 15-Oct-84 17:04:22 EDT
Article-I.D.: desint.157
Posted: Mon Oct 15 17:04:22 1984
Date-Received: Wed, 17-Oct-84 06:19:21 EDT
References: <527@wjh12.UUCP>
Organization: his home computer, Thousand Oaks, CA
Lines: 21

>   The expression can be made portable, at least under UNIX, by
>having
>	extern end;
>somewhere in a header file, and then replacing "0" in the expression by
>"&end".  For maximum portability, of course, use a real object of type
>struct foo in the expression.

>	Sam Kendall

(What Sam is talking about would then read like this:)

>     (char *)(&((struct foo *)&end)->element) - (char *)&end

Good idea, except am not sure &end is the best symbol to use.  Is &end
actually guaranteed to refer to a legal address by itself?  What about the
other "&e" symbols:  etext and edata?  Is it legal is we replace "&end" with
"(&end-sizeof (struct foo))"?
-- 
	Geoff Kuenning
	First Systems Corporation
	...!ihnp4!trwrb!desint!geoff