www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/09/17/08:22:39

Message-ID: <39C4B88F.B44487D2@softhome.net>
Date: Sun, 17 Sep 2000 14:26:55 +0200
From: Laurynas Biveinis <lauras AT softhome DOT net>
X-Mailer: Mozilla 4.75 [en] (Win98; U)
X-Accept-Language: lt,en
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: deleting NULL ?
References: <8q1u4s$jh3$1 AT info DOT cyf-kr DOT edu DOT pl> <969182875 DOT 671530 AT shelley DOT paradise DOT net DOT nz>
Reply-To: djgpp AT delorie DOT com

Edmund Horner wrote:
> 
> Freeing (or deleting, in C++) the NULL pointer is not supposed to be done!
> Some DPMI servers ignore it, and some (such as DJGPP) will cause a SIGSEGV
> (segment violation) -- you're program will crash, and this is what you want
> to happen!

You would be right if free(NULL) or delete NULL call would directly call DPMI.
But that's not true - C and C++ standards specify NULL as an exception, so
free(NULL) does nothing.

Laurynas

- Raw text -


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