From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32413 invoked by alias); 3 Feb 2003 10:26:07 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 32354 invoked by uid 71); 3 Feb 2003 10:26:05 -0000 Date: Mon, 03 Feb 2003 10:26:00 -0000 Message-ID: <20030203102605.32315.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Danny Smith Subject: Re: c/9539: [Windows] builtin [long/set]jmp not working properly with signals Reply-To: Danny Smith X-SW-Source: 2003-02/txt/msg00089.txt.bz2 List-Id: The following reply was made to PR c/9539; it has been noted by GNATS. From: Danny Smith To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, obry@gnat.com, nobody@gcc.gnu.org, gcc-prs@gcc.gnu.org Cc: Subject: Re: c/9539: [Windows] builtin [long/set]jmp not working properly with signals Date: Mon, 03 Feb 2003 10:18:39 +0000 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=g cc&pr=9539 I wouldn't expect OS signal handling (particularly the Windows flavour) to play nicely with __builtin_setjmp/longjmp because of this comment in builtins.c: /* __builtin_setjmp is passed a pointer to an array of five words (not all will be used on all machines). It operates similarly to the C library function of the same name, but is more efficient. Much of the code below (and for longjmp) is copied from the handling of non-local gotos. NOTE: This is intended for use by GNAT and the exception handling scheme in the compiler and will only work in the method used by them. */ and this excerpt from extend.texi: "GCC provides a large number of built-in functions other than the ones mentioned above. Some of these are for internal use in the processing of exceptions or variable-length argument lists and will not be documented here because they may change from time to time; we do not recommend general use of these functions." Perhaps this disclaimer should be explicitly mention __builtin_setjmp/longjmp as an example of a internal-use only builtin? BTW the callback for SetUnhandledExceptionFilter should be a stdcall function, else you risk stack corruption. GCC warns about that with: warning: passing arg 1 of `SetUnhandledExceptionFilter' from incompatible pointer type Danny