Path: utzoo!mnetor!uunet!mcvax!philmds!leo From: leo@philmds.UUCP (Leo de Wit) Newsgroups: comp.lang.c Subject: Re: Turbo C Problem? Message-ID: <388@philmds.UUCP> Date: 1 Mar 88 11:56:40 GMT References: <44100006@hcx2> Reply-To: leo@philmds.UUCP (L. J. M. de Wit) Organization: Philips I&E DTS Eindhoven Lines: 25 It could be that your program has not allocated enough stack space. I myself had a similar problem using a Lattice-C compiler for the Atari-ST. The compiler reserves some default stack space for the program to run in (usually about 2K). You can alter it by initiating the global variable _stack, e.g.: int _stack = WHAT_I_NEED; Also the actual memory requirements for the program can be set by assigning to an other global, _mneed: int _mneed = ALL_I_CAN_GET; /* or something like that */ The default for the Atari is that all but 4K of the memory is taken by the program. So if you're planning to write a shell or a make utility or whatever program that does have to leave some memory, use this assignment. The bomb that goes off in your program could be that by assigning to the structure elements (which are on the stack) you end up by writing on addresses that have not been reserved for the stack. So the solution seems to me: either use something similar like the above (check your compiler!) or don't push such large data elements on the stack (small machines, but also even large ones generally don't like that); use static allocation for that. L.J.M. de Wit