Register functions ?

jab at uokvax.UUCP jab at uokvax.UUCP
Mon Sep 24 13:33:00 AEST 1984


/***** uokvax:net.lang.c / tikal!warren /  8:33 pm  Sep 21, 1984 */

	C would benefit from a new storage class, I hereby dub "private".
	Private storage items, whether const or variable, would be not
	exportable.  The "private" declaration is intended to get around
	the "aliasing" problem in C, where two expressions (say, "x" and
	"*y") cannot be assumed to point at different objects (they could
	both point to the same place).   If x is declared "private", then
	y must point somewhere else.

/* ---------- */

"must point somewhere else"?

The idea of a "PRIVATE/LOCAL" variable is nifty, and gets rid of
many "aliasing" problems, I'm sure. In a language such as "C", in
which a pointer can contain ANY valid address (where "valid" refers
to "hardware address space" and not "external variable") you
won't get what you really want.

I suspect that the way to get that might be to change a pointer to be type-
specific, and for locations to contain "datum" and "type information on that
datum", with checks performed by the hardware. Anyone want to venture to guess
what the overhead would be?

	Jeff Bowles
	Lisle, IL



More information about the Comp.lang.c mailing list