Date: Tue, 23 Jun 1998 10:28:28 +0300 (IDT) From: Eli Zaretskii To: Morten Welinder cc: djgpp-workers AT delorie DOT com Subject: Re: setjmp In-Reply-To: <199806230336.FAA23970@tyr.diku.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 23 Jun 1998, Morten Welinder wrote: > If I recall correctly, setjmp should be a macro, not a library function. It amazes me time and again how many subtle points can the ANSI C Standard have, even for somebody who uses the language for a long time... Here's what ANSI C says about this: 7.6 Nonlocal jumps .... It is unspecified whether `setjmp' is a macro or an identifier declared with external linkage. If a macro definition is suppressed in order to access an actual function, or if a program defines an external identifier with the name `setjmp', the behavior is undefined. The Standard then goes on referencing `setjmp' as ``the setjmp macro'' throughout the rest of the text ;-). P.J. Plauger's ``The Standard C Library'' explains that defining a function `setjmp' and a macro with that same name is a way to ensure that no program declares `setjmp' if it includes , and no program defines its own function `setjmp', even if it doesn't include . So it seems that either macro or function is okay, and if we want to accept Plauger's suggestion, then adding something like the following to should be enough: #define setjmp(foo) setjmp(foo) I suggest to add this line. Comments?