Date: Tue, 31 Aug 1999 09:28:30 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Dave Bird cc: djgpp AT delorie DOT com Subject: Re: Error General Fault Protection on quit??? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 30 Aug 1999, Dave Bird wrote: > > void validate_or_die (void *ptr) > > { > > if ( (unsigned)p < 0x1000) > > abort (); > > } > > Sounds possible... I'd prefer to log or report rather than abort, That's up to you, but `abort' has an advantage of producing a traceback, which shows you the entire sequence of function calls that led to the problem; whereas in a log message it is not trivial to print enough information to let you know who's the villain. Anyway, why let a program that dereferences NULL run? ;-) > and is there an upper limit?? The upper limit is the data segment limit. But you don't have to check that, since any protected-mode environment, including Windows, catches those cases and crashes your program with a GPF.