Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 7/1/84; site CSL-Vax.ARPA
Path: utzoo!linus!decvax!decwrl!CSL-Vax!mann
From: mann@CSL-Vax.ARPA (Tim Mann)
Newsgroups: net.lang.c
Subject: Re: setjmp and typedef'd arrays; thoughts on &array
Message-ID: <975@CSL-Vax.ARPA>
Date: Sat, 13-Oct-84 14:16:50 EDT
Article-I.D.: CSL-Vax.975
Posted: Sat Oct 13 14:16:50 1984
Date-Received: Tue, 16-Oct-84 05:21:38 EDT
References: <22197810.8e4@apollo.uucp> <981@bbncca.ARPA> <524@wjh12.UUCP> <> <394@ncoast.UUCP>
Organization: Stanford University
Lines: 28

> C purportedly handles arrays as if they were blocks of data and pointers.
> However, it doesn't, quite.  The declaration
> 
> 	char **foo, bar[10];
> 
> should allow me to say
> 
> 	foo = &bar;
> 
> later on.h, since bar should be a pointer to char.  Unfortunately, bar
> is what I call a VIRTUAL pointer -- it assembles as a literal (look at
> your compiler's output).  To work correctly, it would have to assemble
> to a constant pointer which always points to a particular block of memory,
> in which case the above would work.  (Notice that the above is essentially
> the jmp_buf, expanded.)  Instead, there is no such thing as &bar because
> bar is not a variable, it is a literal.

This is not an anomaly, and there is no reason to invent the term "virtual
pointer".  In your example, "bar" is a constant of type pointer-to-char.  As
a constant, it does not have an address.  It is no more legitimate to write
&bar and expect to get the address of a cell containing bar's value, than it
would be to write &1 and expect to get the address of a cell with the value
1 in it.

I'm not going to try to respond to the other points in your message or the
other discussion that's been going on in this area just now.

	--Tim