Mail Archives: djgpp/2002/02/06/05:30:27
Damon Hastings (damonhastings AT yahoo DOT com) wrote:
: Can anyone tell me why the following program fails under djgpp on my
: machine?
: main() {
: char foo[524273];
: for (int i=0; i<524273; i++) foo[i] = 0;
: }
foo isn't static, it's automatic.
: Pretty simple, right? Well, it sometimes throws a SIGSEGV fault,
: sometimes locks up, sometimes provokes Windows to pop up an
: application termination dialog, and sometimes spontaneously reboots
: the computer. Similar results under DOS. It works for an array size
: of 524272 or if I use malloc() or new instead of a static array. I
: get the same result if I use int[131069] or if I break it into several
: smaller arrays.
: So I'm guessing this all means djgpp has a 512K stack limit, right?
Yes.
: How do I change this limit? Or do I have no choice but to use the
FAQ 15.9.
Right,
MartinS
- Raw text -