www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/17/01:01:26

Newsgroups: comp.os.msdos.djgpp
From: cigna AT helios DOT phy DOT OhioU DOT Edu (Dave Cigna)
Subject: Re: delete NULL?
Message-ID: <E5pup7.4KM@boss.cs.ohiou.edu>
Sender: news AT boss DOT cs DOT ohiou DOT edu (News Admin)
Organization: Ohio University Physics and Astronomy
References: <19970216 DOT 124451 DOT 7287 DOT 0 DOT fwec AT juno DOT com> <330767f3 DOT 6557055 AT ursa DOT smsu DOT edu> <330775C0 DOT 439E0A61 AT alcyone DOT com>
Date: Sun, 16 Feb 1997 22:05:31 GMT
Lines: 12
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Erik Max Francis  <max AT alcyone DOT com> wrote:
>The draft standard indicates that deleting a null pointer will have no
>effect.  Even if the _Annotated C++ Reference Manual_ reads, "The effect of
>applying delete to a pointer not obtained from the new operator without a
>placement specification is undefined and usually harmful.  Deleting a point
>with the value zero, however, is guaranteed to be harmless" (p. 63).

And wouldn't it be nice if delete not only deallocated the memory used,
but also set the pointer to NULL. This would eliminate the dangers of
deleting something more than once. 

 -- Dave Cigna

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019