summaryrefslogtreecommitdiffstats
path: root/lib/msun/src/s_expm1f.c
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2011-10-21 06:26:38 +0000
committerdas <das@FreeBSD.org>2011-10-21 06:26:38 +0000
commite068faa86b2f941fee33afe19eb3b015e0cb9f61 (patch)
treeefe324dcb8a65c88f3cfebddd083efe5239c4025 /lib/msun/src/s_expm1f.c
parent396066c48af8c4c5b0ae4854e92e6f1d29658134 (diff)
downloadFreeBSD-src-e068faa86b2f941fee33afe19eb3b015e0cb9f61.zip
FreeBSD-src-e068faa86b2f941fee33afe19eb3b015e0cb9f61.tar.gz
Use STRICT_ASSIGN() to ensure that the compiler doesn't screw things
up by storing x in a wider type than it's supposed to. Submitted by: bde
Diffstat (limited to 'lib/msun/src/s_expm1f.c')
-rw-r--r--lib/msun/src/s_expm1f.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/msun/src/s_expm1f.c b/lib/msun/src/s_expm1f.c
index d7dd1b9..fb37494 100644
--- a/lib/msun/src/s_expm1f.c
+++ b/lib/msun/src/s_expm1f.c
@@ -16,6 +16,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <float.h>
+
#include "math.h"
#include "math_private.h"
@@ -74,7 +76,7 @@ expm1f(float x)
hi = x - t*ln2_hi; /* t*ln2_hi is exact here */
lo = t*ln2_lo;
}
- x = hi - lo;
+ STRICT_ASSIGN(float, x, hi - lo);
c = (hi-x)-lo;
}
else if(hx < 0x33000000) { /* when |x|<2**-25, return x */
OpenPOWER on IntegriCloud