From b5c95a09697911df1e4829448b536b2a7728673a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sat, 19 Oct 2024 04:00:52 -0700 Subject: [PATCH] Suppress float16 suffix warnings --- test/dt_arith.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/dt_arith.c b/test/dt_arith.c index 57a0343c99d..6a74ff260fd 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -2966,6 +2966,7 @@ test_conv_flt_1_hw_conv_from_flt(void *hw_dst, unsigned char *src_buf, size_t id #ifdef H5_HAVE__FLOAT16 /* Suppress warning about non-standard floating-point literal suffix */ H5_GCC_CLANG_DIAG_OFF("pedantic") + H5_GCC_DIAG_OFF("c11-c23-compat") *((H5__Float16 *)hw_dst) = (H5__Float16)aligned; @@ -2975,6 +2976,7 @@ test_conv_flt_1_hw_conv_from_flt(void *hw_dst, unsigned char *src_buf, size_t id else if (fabsf(aligned) < (float)FLT16_MIN) ret = 2; + H5_GCC_DIAG_ON("c11-c23-compat") H5_GCC_CLANG_DIAG_ON("pedantic") break; #endif @@ -3046,6 +3048,7 @@ test_conv_flt_1_hw_conv_from_double(void *hw_dst, unsigned char *src_buf, size_t #ifdef H5_HAVE__FLOAT16 /* Suppress warning about non-standard floating-point literal suffix */ H5_GCC_CLANG_DIAG_OFF("pedantic") + H5_GCC_DIAG_OFF("c11-c23-compat") *((H5__Float16 *)hw_dst) = (H5__Float16)aligned; @@ -3055,6 +3058,7 @@ test_conv_flt_1_hw_conv_from_double(void *hw_dst, unsigned char *src_buf, size_t else if (fabs(aligned) < (double)FLT16_MIN) ret = 2; + H5_GCC_DIAG_ON("c11-c23-compat") H5_GCC_CLANG_DIAG_ON("pedantic") break; #endif @@ -3132,6 +3136,7 @@ test_conv_flt_1_hw_conv_from_ldouble(void *hw_dst, unsigned char *src_buf, size_ #ifdef H5_HAVE__FLOAT16 /* Suppress warning about non-standard floating-point literal suffix */ H5_GCC_CLANG_DIAG_OFF("pedantic") + H5_GCC_DIAG_OFF("c11-c23-compat") *((H5__Float16 *)hw_dst) = (H5__Float16)aligned; @@ -3141,6 +3146,7 @@ test_conv_flt_1_hw_conv_from_ldouble(void *hw_dst, unsigned char *src_buf, size_ else if (fabsl(aligned) < (long double)FLT16_MIN) ret = 2; + H5_GCC_DIAG_ON("c11-c23-compat") H5_GCC_CLANG_DIAG_ON("pedantic") break; #endif @@ -3394,6 +3400,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) #ifdef H5_HAVE__FLOAT16 /* Suppress warning about non-standard floating-point literal suffix */ H5_GCC_CLANG_DIAG_OFF("pedantic") + H5_GCC_DIAG_OFF("c11-c23-compat") /* Suppress warning about float conversion in macro code path * that sets H5__Float16 multiply = 100000000;, which shouldn't * happen due to the small value of FLT16_MAX_10_EXP. @@ -3402,6 +3409,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) INIT_FP_NORM(H5__Float16, FLT16_MAX, FLT16_MIN, FLT16_MAX_10_EXP, FLT16_MIN_10_EXP, src_size, dst_size, buf, saved, nelmts); H5_GCC_CLANG_DIAG_ON("float-conversion") + H5_GCC_DIAG_ON("c11-c23-compat") H5_GCC_CLANG_DIAG_ON("pedantic") #else assert(0 && "Should not reach this point!"); @@ -3638,6 +3646,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) /* Suppress warning about non-standard floating-point literal suffix */ H5_GCC_CLANG_DIAG_OFF("pedantic") + H5_GCC_DIAG_OFF("c11-c23-compat") #ifdef H5_HAVE_FABSF16 if (underflow && fabsf16(x) <= FLT16_MIN && fabsf16(hw_half) <= FLT16_MIN) continue; /* all underflowed, no error */ @@ -3646,6 +3655,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) fabsf((float)hw_half) <= (float)FLT16_MIN) continue; /* all underflowed, no error */ #endif + H5_GCC_DIAG_ON("c11-c23-compat") H5_GCC_CLANG_DIAG_ON("pedantic") if (overflow && my_isinf(dendian, buf + j * sizeof(H5__Float16), dst_size, dst_mpos, @@ -4224,6 +4234,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) if (run_test == TEST_NORMAL) { /* Suppress warning about non-standard floating-point literal suffix */ H5_GCC_CLANG_DIAG_OFF("pedantic") + H5_GCC_DIAG_OFF("c11-c23-compat") /* Suppress warning about float conversion in macro code path * that sets H5__Float16 multiply = 100000000;, which shouldn't * happen due to the small value of FLT16_MAX_10_EXP. @@ -4232,6 +4243,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) INIT_FP_NORM(H5__Float16, FLT16_MAX, FLT16_MIN, FLT16_MAX_10_EXP, FLT16_MIN_10_EXP, src_size, dst_size, buf, saved, nelmts); H5_GCC_CLANG_DIAG_ON("float-conversion") + H5_GCC_DIAG_ON("c11-c23-compat") H5_GCC_CLANG_DIAG_ON("pedantic") } else if (run_test == TEST_DENORM) {