Article View: comp.std.c
Article #743Re: Out-of-bounds pointers
From: John Woods
Date: Fri, 13 Oct 1989 00:39
Date: Fri, 13 Oct 1989 00:39
32 lines
1785 bytes
1785 bytes
In article <976@crdos1.crd.ge.COM>, davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) writes:
> | The "benefit" is that faster, more natural C implementations are
> | permitted on architectures where this is an issue.
> Please identify the machines in question and quantify the saving.
> Prevailing practice means what it says, that before compilers were
> modified to make it illegal such code would work on most machines, such
> as VAX, VAX, VAX, VAX, VAX, etc. I think that fairly represents every single
> machine and user running pre-ANSI C.
Well, I've adjusted those last 2 sentences a teeny bit, but the meaning is
exactly the same. To review the conclusion of the comp.lang.c.flame
discussion:
main() {
extern void paint_memory_blue(char *p, int len);
char *p = malloc(1000); /* OK. */
paint_memory_blue(p, 1000); /* it better accept NULL... */
free(p); /* OK */
if (p == NULL) /* Right here, a capability machine may fault.
* And it is the programmer's fault for writing this.
* If you don't know what a capability machine is,
* STOP ARGUING WHAT MACHINES WILL OR WON'T DO!!!
* In the words of Dennis M. Ritchie,
* "This is non-negotiable."
*/
;
}
Everybody clear now?
--
John Woods, Charles River Data Systems, Framingham MA 508-626-1101
...!decvax!frog!john, john@frog.UUCP, ...!mit-eddie!jfw, jfw@eddie.mit.edu
Technical Details
Message-ID:
<2103@frog.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!bu-cs!mirror!frog!johnReferences:
<1009@mtxinu.UUCP> <12570028@hpclwjm.HP.COM> <868@crdos1.crd.ge.COM> <976@crdos1.crd.ge.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!bu-cs!mirror!frog!john From: john@frog.UUCP (John Woods) Newsgroups: comp.std.c Subject: Re: Out-of-bounds pointers Message-ID: <2103@frog.UUCP> Date: 13 Oct 89 00:39:00 GMT References: <1009@mtxinu.UUCP> <12570028@hpclwjm.HP.COM> <868@crdos1.crd.ge.COM> <976@crdos1.crd.ge.COM> Organization: Misanthropes-R-Us Lines: 32