X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Wed, 6 Feb 2002 14:15:38 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Damon Hastings cc: djgpp AT delorie DOT com Subject: Re: Help! Can't allocate 512KB static array?? In-Reply-To: <76c7896d.0202060135.4fbf94e9@posting.google.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 6 Feb 2002, Damon Hastings wrote: > And it would be *nice* if I got a compile-time error instead > of spontaneous reboots Unfortunately, this is impossible: there's no way the compiler could tell what would be the max stack limit of the binary, since (as the FAQ explains in section 15.9) the run-time stack limit can be changed by running the stubedit utility on the executable program. As for reboots, preventing them is a very hard problem, given the limitations of the DPMI spec. One solution was tried in the past, but it had so many adverse side effects that it was abandoned. With the 512KB default limit, this problem only haunts newcomers who don't read the docs and at the same time define preposterously large automatic arrays. This combination turns out to be so rare that I haven't seen such complaints for months, if not years.