This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]


Zack Weinberg writes:

> cpplib unconditionally defines __HAVE_BUILTIN_SETJMP__ to 1.  This was
> added back in 1996:
> Sat Jan 27 07:59:25 1996  Richard Kenner  (
>         * tree.h (enum built_in_function): Add BUILT_IN_{SET,LONG}JMP.
>         * expr.c: Include hard-reg-set.h.
>         (arg_pointer_save_area): New declaration.
>         (expand_builtin, case BUILT_IN_{SET,LONG}JMP): New cases.
>         * (expr.o): Includes hard-reg-set.h.
>         * c-decl.c (init_decl_processing): Add definitions for
>         __builtin_setjmp and __builtin_longjmp.
>         * cccp.c (initialize_builtins): Add def of __HAVE_BUILTIN_SETJMP__.
> I can find no references to this macro anywhere.  What was it for?

Presumably it was so people who wanted to use __builtin_setjmp() could write

	  /* the fast version -- use GCC's __builtin_setjmp() */
	  #define my_setjmp __builtin_setjmp
	  #define my_longjmp __builtin_longjmp
	  typedef void *my_jmpbuf[5];
	  /* the portable version -- use the standard ANSI/ISO C setjmp() */
	  #include <setjmp.h>
	  #define my_setjmp setjmp
	  #define my_longjmp longjmp
	  typedef jmpbuf_t my_jmpbuf;

You could use something like

	#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))

instead of

so it is not strictly necessary, but the definition of __HAVE_BUILTIN_SETJMP__
is pretty harmless, so personally I would leave it in to avoid breaking any
existing code which relies on it.

Fergus Henderson <>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <>  |     -- the last words of T. S. Garp.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]