summaryrefslogtreecommitdiffstats
path: root/arith.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-09-14 07:15:53 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-09-14 07:15:53 -0700
commit7464eef7a1c742ae24500d2813967780c25f5787 (patch)
treea0a05a2c47b91e7fe49ee4863ddc25d34163bdcb /arith.c
parent6e354e1c2d5d64d18f527d52db75e344a9223d95 (diff)
downloadtxr-7464eef7a1c742ae24500d2813967780c25f5787.tar.gz
txr-7464eef7a1c742ae24500d2813967780c25f5787.tar.bz2
txr-7464eef7a1c742ae24500d2813967780c25f5787.zip
nan-boxing: use GCC pragmas to disable aliasing warnings.
* arith.c (flo): The line of code which triggers the aliasing diagnostic is wrapped with GNU-C-specific pramgas that disable the diagnostic just for that line. * lib.h (c_f): Likewise. * configure: Drop the test which adds -Wno-strict-aliasing to the DIAG_FLAGS;
Diffstat (limited to 'arith.c')
-rw-r--r--arith.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arith.c b/arith.c
index 30847a4a..d135e2a4 100644
--- a/arith.c
+++ b/arith.c
@@ -4274,7 +4274,14 @@ val flo(double n)
uw_throw(numeric_error_s, lit("out-of-range floating-point result"));
} else {
#if CONFIG_NAN_BOXING
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstrict-aliasing"
+#endif
ucnum u = *(ucnum *) &n + NAN_FLNUM_DELTA;
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
return coerce(val, u);
#else
val obj = make_obj();