www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/07/05:12:51

Date: Wed, 7 Oct 1998 12:12:54 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp AT delorie DOT com
Subject: Re: Linear address 0 makes my day ;)
In-Reply-To: <19981007065343.24344.qmail@hotmail.com>
Message-ID: <Pine.SUN.3.91.981007120742.23475P-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Tue, 6 Oct 1998, Jari Tuominen wrote:

> I have been wondering about CWSDPMI memory management,
> why it won't allow using of Linear Address 0?

Because accessing a null pointer is a very common programmatic error.  
ANSI C assures that no real address is zero, so any program that uses 
such addresses has a bug.

> Windows DPMI allows it !

Somebody already pointed out that Windows itself has so many bugs that it 
probably won't be able to run without letting null pointers live and 
thrive.

> Is there any ways to solve this annoying bug?

This is not a bug, it's a feature, and a great help to locating bugs in 
your programs.  Why would you need to remove it?  Do you like your code 
to use uninitialized pointers that peek up garbled values?

If you really need that, you could remove the part of the startup code 
which calls the DPMI function to protect the null page.  It's in crt0.s 
inside djlsr201.zip.

- Raw text -


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