home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19761 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  991 b 

  1. Path: sparky!uunet!news.centerline.com!matt
  2. From: matt@centerline.com (Matt Landau)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Result of delete operator applied to null pointer?
  5. Date: 22 Jan 1993 17:33:35 GMT
  6. Organization: CenterLine Software, Inc.
  7. Lines: 14
  8. Message-ID: <1jpb5fINN662@armory.centerline.com>
  9. References: <1993Jan22.145654.10001@bradford.ac.uk>
  10. NNTP-Posting-Host: 140.239.1.32
  11.  
  12. In <1993Jan22.145654.10001@bradford.ac.uk> T.D.G.Sandford@bradford.ac.uk (TDG SANDFORD) writes:
  13.  
  14. >Is the effect of applying the delete operator to a null pointer defined?
  15.  
  16. Yes, the effect is defined.  Deleting a null pointer is supposed to
  17. be safe (ARM, section 5.3.4).
  18.  
  19. Note that there is a bug in USL cfront 3.0.1 that causes "delete[] p"
  20. to crash if p is NULL and p's destructor is virtual.  For this reason,
  21. you might want to check for null pointers anyway, at least when using
  22. delete[].
  23. --
  24.  Matt Landau            Waiting for a flash of enlightenment
  25.  matt@centerline.com              in all this blood and thunder
  26.