[lsb-discuss] Enabling FP traps in LSB code

Wichmann, Mats D mats.d.wichmann at intel.com
Sat Nov 10 10:32:00 PST 2007


lsb-discuss-bounces at lists.linux-foundation.org wrote:
> I'm writing some test code for various run-time error handling.
> So I need to be able to generate floating-point errors and
> control how they're handled. The errors I want to generate and
> trap are divide-by-zero, overflow, and invalid operation, and
> I'm working on x86 and x86-64.
> 
> Generating the errors is quite easy with code, but persuading
> an LSB-built program to trap on them is more difficult. It
> doesn't seem to be possible to enable or disable specific
> floating-point traps with the C99 facilities that LSB supports.
> Or if it's possible, some indication of how would be very welcome!
> 
> I can enable traps easily with feenableexcept(), which is a
> GNU extension to C99, but if I do that, I have to link with
> cc, rather than lsbcc, to get the full GNU libm which supplies
> feenableecept(). So an LSB way of doing this would be good.
> If I use feenableecept(), I get SIGFPE generated without further
> difficulty, which is what I want.

As an update, we talked about these during the face-to-face
meeting this past week and the consensus was to go ahead and
squeeze these in for LSB 3.2, given their long-standing support
(went into glibc in 1999) and reasonable documentation.

These are tracked as bug 1767.

Your timing was very good this time :-)




More information about the lsb-discuss mailing list