Re: gcc/libm floating-point bug?

From: Bruce Evans <bde_at_zeta.org.au>
Date: Thu, 29 May 2003 01:36:29 +1000 (EST)
On Tue, 27 May 2003, Terry Lambert wrote:

> BTW: signal stacks are irrelevent; technically, you are not
> allowed to do floating point in signal handlers anyway.  8-).

Not true.  Signal handlers can do almost anything with local variables.
The main relevant restrictions on them is that they must not access
any static or global variables (other than write-only accesses to
objects whose type is volatile sig_atomic_t) or call any functions
that might make such accesses (which rules out calling most functions
including everything in libm).  These restrictions (and bugs) just
make doing floating in signal handlers not very useful.  Doing significant
floating point calculations in signal handlers might involve duplicating
functions from libm inline or as signal-safe private functions.
Outputting the results or otherwise influencing the world might involve
converting the results to arrays of bits and assigning the bits to
sig_atomic_t objects for later interpretation.

Bruce
Received on Wed May 28 2003 - 06:36:56 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:09 UTC