From: Andrew Crabtree Message-Id: <199707221524.AA040975050@typhoon.rose.hp.com> Subject: Re: Weird static/dynamic allocation crash... To: kennw AT tidalwave DOT net (Kenn White) Date: Tue, 22 Jul 1997 8:24:10 PDT Cc: djgpp AT delorie DOT com In-Reply-To: <3.0.1.32.19970722035329.0069bfd4@postoffice.tidalwave.net>; from "Kenn White" at Jul 22, 97 3:53 am Precedence: bulk > It seems that when the integer x is forceably set (i.e., > statically allocated) Not quite. Variables are only statically allocated if the are declared globally or with the static keyword. You are doing neither, which means it will be automatically allocated from the stack. > int main(void) { > > #ifdef STRANGE > int a, x[SIZE]; > #endif > Stack Fault at eip=00001571 So it stack faults. DJGPP uses a fixed size stack. You are overrunning it. You can use stubedit on your executable to increase the stack size or just use the malloc method. -- _______ ___________________________________________________________ / Andrew Crabtree / Workgroup Networks Division ____ ___ / Hewlett-Packard / / / / Roseville, CA __/ __/ _____/ 916/785-1675 / andrewc AT rosemail DOT rose DOT hp DOT com ___________ __/ _____________________________________________________