www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/04/07:13:16

Date: Thu, 4 Mar 1999 13:16:19 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Rehammar <rehammar AT telia DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: DJGPP an page fault
In-Reply-To: <36de653a.0@d2o25.telia.com>
Message-ID: <Pine.SUN.3.91.990304130936.5429C-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Thu, 4 Mar 1999, Rehammar wrote:

> double _min,_max;
> int n;
> 
> _min=0;
> _max=0;
> n=0;
> 
> When I set thees vars to 0 I get page fault. Why !!

First, together with the page fault you get a registers' dump and a call 
stack traceback; please always post them here when you report such 
problems.  People who can read that information might be able to diagnose 
the cause of your trouble much faster when they have it.

Second, section 12.2 of the DJGPP FAQ list explains how to interpret the 
crash dump yourself and how to begin debugging the problem using that 
info.

And third, you are advised not to use variables with global scope whose 
names begin with an underscore.  ANSI standard specifies that such names 
are reserved by the system libraries, so using them might cause surprises 
and even crashes (e.g., imagine that the library defines a function or a 
const variable by that name).  Please try renaming these two variables 
and see if names like my_min and my_max make the problem go away (min
and max are not a good idea, either).

If nothing above helps, post the shortest complete program that exhibits 
this problem.

- Raw text -


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