Mail Archives: djgpp/1999/03/04/07:13:16
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 -