C library errors -> C++ exceptions
From: Lionel B (google_at_lionelb.com)
Date: 10/07/04
- Next message: Richard Herring: "Re: What's the use of operator()?"
- Previous message: assaarpa: "Re: How to create a bitmap?"
- Next in thread: Bob Hairgrove: "Re: C library errors -> C++ exceptions"
- Reply: Bob Hairgrove: "Re: C library errors -> C++ exceptions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 7 Oct 2004 03:13:43 -0700
System: Pentium 4, Win32, gcc 3.3.3 cygwin
Does anyone know of a mechanism whereby C library functions can be made
to throw a (C++) exception in case a call fails? This would obviate
having to check the results of function calls individually at the point
of call.
I would also be nice to be able to specify that (some) floating point
IEEE 754 "exceptions" throw C++ exceptions (some of the time).
I note that the glibc documentation suggests that "traps" may be
enabled to cause fp "exceptions" to generate a SIGFPE signal. This
suggests a possible workaround whereby a signal handler could catch the
SIGFPE signal and throw an exception (OTOH I have heard that signals
and C++ exceptions do not necessarilly mix well). This is academic, as
I have not found a way - perhaps it is not possible - to enable fp
traps for my system.
Any help/ideas appreciated,
-- Lionel B
- Next message: Richard Herring: "Re: What's the use of operator()?"
- Previous message: assaarpa: "Re: How to create a bitmap?"
- Next in thread: Bob Hairgrove: "Re: C library errors -> C++ exceptions"
- Reply: Bob Hairgrove: "Re: C library errors -> C++ exceptions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|