Article View: comp.arch
Article #12901Re: Available no. of registers
From: radford
Date: Tue, 27 Jan 1987 18:44
Date: Tue, 27 Jan 1987 18:44
24 lines
1845 bytes
1845 bytes
In article <213@ames.UUCP>, fouts@orville (Marty Fouts) writes:
> In article <763@vaxb.calgary.UUCP> radford@calgary.UUCP (Radford Neal) writes:
> >I know C is poorly designed, but is it really THIS bad?! Did Kernighan and
> >Ritchie suffer from this level of brain damage? Does anyone know?
> >
>
> A pointer points to an address in memory. manipulating items at offsets from
> that address by using that pointer is just fine. A common valid use is to
> set a char pointer to the first character in a string and then increment the
> pointer to examine succesive characters. There is nothing in the language
> that requires the programmer to stop at the end of the string. . .
Look, give me credit for some intelligence. When I wrote the first comment
above I was quite aware of all the usual uses of pointer arithmetic. I am
quite aware that a compiler must allocate the members of an array in such a
fashion that pointer arithmetic scans through them. I am NOT aware of any
requirement that local variables be allocated storage in the order they are
declared. Hence my remark expressing incredulity at someone claiming that
a compiler had to do this.
Note that it is quite irrelevant whether the compiler gives a compile-time
error for programs depending on this.
Radford Neal
Technical Details
Message-ID:
<769@vaxb.calgary.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbatt!ihnp4!alberta!calgary!radfordReferences:
<3810002@nucsrl.UUCP> <926@mips.UUCP> <759@vaxb.calgary.UUCP> <213@ames.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbatt!ihnp4!alberta!calgary!radford From: radford@calgary.UUCP Newsgroups: comp.arch Subject: Re: Available no. of registers Message-ID: <769@vaxb.calgary.UUCP> Date: Tue, 27-Jan-87 13:44:01 EST Article-I.D.: vaxb.769 Posted: Tue Jan 27 13:44:01 1987 Date-Received: Fri, 30-Jan-87 05:23:51 EST References: <3810002@nucsrl.UUCP> <926@mips.UUCP> <759@vaxb.calgary.UUCP> <213@ames.UUCP> Organization: U. of Calgary, Calgary, Ab. Lines: 24