diff options
-rw-r--r-- | arith.c | 7 | ||||
-rwxr-xr-x | configure | 18 | ||||
-rw-r--r-- | lib.h | 7 |
3 files changed, 14 insertions, 18 deletions
@@ -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(); @@ -1603,24 +1603,6 @@ if [ -n "$nan_boxing" ] ; then fi fi -if [ -n "$nan_boxing" ] ; then - printf "Checking how to disable strict aliasing warnings ... " - - cat > conftest.c <<! -int main(void) -{ - return 0; -} -! - - if conftest EXTRA_FLAGS=-Wno-strict-aliasing ; then - printf -- "-Wno-strict-aliasing\n" - diag_flags="$diag_flags -Wno-strict-aliasing" - else - printf "unknown\n" - fi -fi - printf "Checking for intmax_t ... " cat > conftest.c <<! #include <inttypes.h> @@ -625,7 +625,14 @@ INLINE double c_f(val num) { #if CONFIG_NAN_BOXING ucnum u = coerce(ucnum, num) - NAN_FLNUM_DELTA; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif return *coerce(double *, &u); +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif #else return num->fl.n; #endif |