delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/30/11:55:49

Message-ID: <37CA027B.E6F6EACD@unb.ca>
From: Endlisnis <s257m AT unb DOT ca>
X-Mailer: Mozilla 4.61 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Error GPF on quit?
References: <7pvk33$ut4$1 AT nnrp1 DOT deja DOT com> <7q04p6$9qu$1 AT nnrp1 DOT deja DOT com> <OQPw3.5573$ei1 DOT 10963 AT newsfeeds DOT bigpond DOT com> <7qcrem$6vd$1 AT solomon DOT cs DOT rose-hulman DOT edu>
Lines: 35
Date: Mon, 30 Aug 1999 04:03:21 GMT
NNTP-Posting-Host: 207.179.152.83
X-Trace: news21.bellglobal.com 935985801 207.179.152.83 (Mon, 30 Aug 1999 00:03:21 EDT)
NNTP-Posting-Date: Mon, 30 Aug 1999 00:03:21 EDT
Organization: Sympatico
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Damian Yerrick wrote:

> > I still say that GPF is produced from your array indices being out of
> > bounds. Remember, don't test in windows as you won't see any error from
> that
> > code at all (i tested the exe you sent me). The Windows DPMI server has a
> > habit of letting pointer dereferences pass.
>
> I don't know about Windows 95 (I've only owned Win 3.1, Win 98, and Macs),
> but you can tell Windows 98's DPMI to be tougher about pointer dereferences
> by telling it to protect memory. This will slow your program slightly, but
> that's normal for debugging.

    But, that still doesn't prevent, or even warn about null pointer
dereferencing.  Here is an example:

#include <stdio.h>

int main()
{
 int* null = 0;
 printf("*null=%i\n", *null);
 *null = 7;
 }

This does not GPF or anything else under Win98, even with the "Protected"
option selected.

--
     (\/) Endlisnis (\/)
          s257m AT unb DOT ca
          Endlisnis AT HotMail DOT com
          ICQ: 32959047


- Raw text -


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