This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/16198] New: fegetenv() clears exception mask on x86_64
- From: "fxcoudert at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 20 Nov 2013 22:50:03 +0000
- Subject: [Bug math/16198] New: fegetenv() clears exception mask on x86_64
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=16198
Bug ID: 16198
Summary: fegetenv() clears exception mask on x86_64
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: math
Assignee: unassigned at sourceware dot org
Reporter: fxcoudert at gcc dot gnu.org
Take the following code:
#include <stdio.h>
#include <fenv.h>
int main (void)
{
fenv_t e;
printf ("%d\n", fegetexcept () & FE_INVALID ? 1 : 0);
feenableexcept (FE_INVALID);
printf ("%d\n", fegetexcept () & FE_INVALID ? 1 : 0);
fegetenv (&e);
printf ("%d\n", fegetexcept () & FE_INVALID ? 1 : 0);
fesetenv (&e);
printf ("%d\n", fegetexcept () & FE_INVALID ? 1 : 0);
}
I expect it to output "0 1 1 1", and it does on i386-linux. But on
x86_64-linux, it outputs "0 1 0 1", showing that the call to fegetenv() clears
the exception mask. I don't see this behavior documented, and I don't think
it's allowed.
--
You are receiving this mail because:
You are on the CC list for the bug.