stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: 18.exception.cpp test on Cygwin
Date Wed, 08 Aug 2007 20:46:32 GMT
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [] 
>> Sent: Wednesday, August 08, 2007 9:27 PM
>> To:
>> Subject: Re: 18.exception.cpp test on Cygwin
>> Farid Zaripov wrote:
>>>   The 18.exception.cpp test fails to compile on gcc 3.4.4/Cygwin.
>> Do you have a suggestion for a fix?
>   I see 3 possible ways:
> 1) fix only 18.exception.cpp test to use ::setjmp() instead of
> std::setjmp() (#including <setjmp.h> instead of <csetjmp>)
> 2) in our ansi/csetjmp header file add checking and #defining setjmp
> macro:
> #ifndef setjmp
> #define setjmp(env) setjmp (env)
> #endif

This seems like the best solution to me. C++ requires that setjmp
be a macro, so if we detect that it's not define we should define
it ourselves. The only question is what to #define the macro to.
I suppose we could just make the assumption that when the macro
is not #defined there is a function with the same name in file
scope and #define it exactly as you've done above. Alternatively,
we could try to detect where the function is declared in a config
test and use that in the definition of the macro, but that seems
like too much effort for little gain. The function could reasonably
only be declared in two namespaces: the global one or std. I think
assuming it's the former is probably safe.


> 3) check for presence of setjmp() function using new /etc/src/SETJMP.cpp
> file and introduce it in std namespace
> in our ansi/csetjmp header file:
> #ifndef _RWSTD_NO_SETJMP
> namespace std {
> using ::setjmp;
> } // namespace std
> #endif
> Farid.

View raw message