www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/02/08/10:59:11

X-Authentication-Warning: acp3bf.physik.rwth-aachen.de: broeker owned process doing -bs
Date: Thu, 8 Feb 2001 15:38:31 +0100 (MET)
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
X-Sender: broeker AT acp3bf
To: DJGPP Workers <djgpp-workers AT delorie DOT com>
cc: Stephen Silver <djgpp AT argentum DOT freeserve DOT co DOT uk>
Subject: Re: setjmp.h - namespace std patch
In-Reply-To: <Pine.SUN.3.91.1010208161713.23371A-100000@is>
Message-ID: <Pine.LNX.4.10.10102081532150.299-100000@acp3bf>
MIME-Version: 1.0
X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by delorie.com id JAA31007
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 8 Feb 2001, Eli Zaretskii wrote:

> 
> On Thu, 8 Feb 2001, Stephen Silver wrote:
> 
> > 17.4.1.2 paragraph 5:
> > 
> >     Names which are defined as macros in C shall be defined as
> >     macros in the C++ Standard Library, even if C grants license for
> >     implementation as functions. [Note: the names defined as macros
> >     in C include the following: assert, errno, offsetof, setjmp,
> >     va_arg, va_end, and va_start. —end note]
> 
> This seems to indicate that setjmp should be a macro in C as well.  

Well, the headline of the relevant section in the ISO C90 standard is:

7.6.1.1 The setjmp macro

:-) And in the chapter lead-in (7.6), it explicitly states that no program
is allowed to do either of the following

*) #undef setjmp
*) call (setjmp)(myjmpbuf) to access the function setjmp, not the macro.
*) define their own function setjmp (with external linkage)

I.e., for all means and purposes outside the C implementation itself,
setjmp *is* a macro.

> perhaps we need to make "#define setjmp setjmp" be visible even outside 
> #ifdef __cplusplus.

At least it wouldn't hurt. The language definition clearly says that any
program that would be broken by such a #define deserves to be broken.

-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019