17_intro/header_csetjmp.cc

Loren James Rittle rittle@latour.rsch.comm.mot.com
Wed Mar 28 16:00:00 GMT 2001


17_intro/header_csetjmp.cc is failing with:

[...]/17_intro/header_csetjmp.cc:32:6: #error "setjmp_must_be_a_macro"

According to section 17.4.1.2 clause 5 of ISO 14882:1998 "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."

According to section 7.13 clause 3 of ISO 9899:1999: "It is
unspecified whether setjmp is a macro or an identifier declared with
external linkage."

Thus <csetjmp> [i.e. ./std/csetjmp or the file it directly includes
(Aside, is it: ./c/bits/std_csetjmp.h or ./c_std/bits/std_csetjmp.h? ;-)]
should provide a macro for setjmp if it is not found after including
<setjmp.h>.

This code should go in one of those files (I personally think it
should go right after the ``#include <setjmp.h>''):

#ifndef setjmp
#define setjmp(env) setjmp (env)
#endif

I will do a patch, if someone tells me how to know which file it
should go in. ;-)

Regards,
Loren



More information about the Libstdc++ mailing list