L
Lionel B
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,
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,