Skip to content

Commit

Permalink
Suppress float16 suffix warnings w/ gcc-14
Browse files Browse the repository at this point in the history
  • Loading branch information
derobins committed Oct 19, 2024
1 parent db41b64 commit f230e3f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/H5Tconv_float.c
Original file line number Diff line number Diff line change
Expand Up @@ -1732,7 +1732,9 @@ H5T__conv_float__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, c
{
/* Suppress warning about non-standard floating-point literal suffix */
H5_GCC_CLANG_DIAG_OFF("pedantic")
H5_GCC_DIAG_OFF("c11-c23-compat")
H5T_CONV_Ff(FLOAT, FLOAT16, float, H5__Float16, -FLT16_MAX, FLT16_MAX);
H5_GCC_DIAG_ON("c11-c23-compat")
H5_GCC_CLANG_DIAG_ON("pedantic")
}
#endif
Expand Down Expand Up @@ -1991,7 +1993,9 @@ H5T__conv_double__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata,
{
/* Suppress warning about non-standard floating-point literal suffix */
H5_GCC_CLANG_DIAG_OFF("pedantic")
H5_GCC_DIAG_OFF("c11-c23-compat")
H5T_CONV_Ff(DOUBLE, FLOAT16, double, H5__Float16, -FLT16_MAX, FLT16_MAX);
H5_GCC_DIAG_ON("c11-c23-compat")
H5_GCC_CLANG_DIAG_ON("pedantic")
}
#endif
Expand Down Expand Up @@ -2255,7 +2259,9 @@ H5T__conv_ldouble__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata,
{
/* Suppress warning about non-standard floating-point literal suffix */
H5_GCC_CLANG_DIAG_OFF("pedantic")
H5_GCC_DIAG_OFF("c11-c23-compat")
H5T_CONV_Ff(LDOUBLE, FLOAT16, long double, H5__Float16, -FLT16_MAX, FLT16_MAX);
H5_GCC_DIAG_ON("c11-c23-compat")
H5_GCC_CLANG_DIAG_ON("pedantic")
}
#endif
Expand Down
14 changes: 14 additions & 0 deletions src/H5Tconv_integer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,9 @@ H5T__conv_ushort__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata,
{
/* Suppress warning about non-standard floating-point literal suffix */
H5_GCC_CLANG_DIAG_OFF("pedantic")
H5_GCC_DIAG_OFF("c11-c23-compat")
H5T_CONV_Xf(USHORT, FLOAT16, unsigned short, H5__Float16, -FLT16_MAX, FLT16_MAX);
H5_GCC_DIAG_ON("c11-c23-compat")
H5_GCC_CLANG_DIAG_ON("pedantic")
}
#endif
Expand Down Expand Up @@ -1972,7 +1974,9 @@ H5T__conv_int__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, con
{
/* Suppress warning about non-standard floating-point literal suffix */
H5_GCC_CLANG_DIAG_OFF("pedantic")
H5_GCC_DIAG_OFF("c11-c23-compat")
H5T_CONV_Xf(INT, FLOAT16, int, H5__Float16, -FLT16_MAX, FLT16_MAX);
H5_GCC_DIAG_ON("c11-c23-compat")
H5_GCC_CLANG_DIAG_ON("pedantic")
}
#endif
Expand Down Expand Up @@ -2201,7 +2205,9 @@ H5T__conv_uint__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, co
{
/* Suppress warning about non-standard floating-point literal suffix */
H5_GCC_CLANG_DIAG_OFF("pedantic")
H5_GCC_DIAG_OFF("c11-c23-compat")
H5T_CONV_Xf(UINT, FLOAT16, unsigned int, H5__Float16, -FLT16_MAX, FLT16_MAX);
H5_GCC_DIAG_ON("c11-c23-compat")
H5_GCC_CLANG_DIAG_ON("pedantic")
}
#endif
Expand Down Expand Up @@ -2430,7 +2436,9 @@ H5T__conv_long__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, co
{
/* Suppress warning about non-standard floating-point literal suffix */
H5_GCC_CLANG_DIAG_OFF("pedantic")
H5_GCC_DIAG_OFF("c11-c23-compat")
H5T_CONV_Xf(LONG, FLOAT16, long, H5__Float16, -FLT16_MAX, FLT16_MAX);
H5_GCC_DIAG_ON("c11-c23-compat")
H5_GCC_CLANG_DIAG_ON("pedantic")
}
#endif
Expand Down Expand Up @@ -2659,7 +2667,9 @@ H5T__conv_ulong__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, c
{
/* Suppress warning about non-standard floating-point literal suffix */
H5_GCC_CLANG_DIAG_OFF("pedantic")
H5_GCC_DIAG_OFF("c11-c23-compat")
H5T_CONV_Xf(ULONG, FLOAT16, unsigned long, H5__Float16, -FLT16_MAX, FLT16_MAX);
H5_GCC_DIAG_ON("c11-c23-compat")
H5_GCC_CLANG_DIAG_ON("pedantic")
}
#endif
Expand Down Expand Up @@ -2888,7 +2898,9 @@ H5T__conv_llong__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, c
{
/* Suppress warning about non-standard floating-point literal suffix */
H5_GCC_CLANG_DIAG_OFF("pedantic")
H5_GCC_DIAG_OFF("c11-c23-compat")
H5T_CONV_Xf(LLONG, FLOAT16, long long, H5__Float16, -FLT16_MAX, FLT16_MAX);
H5_GCC_DIAG_ON("c11-c23-compat")
H5_GCC_CLANG_DIAG_ON("pedantic")
}
#endif
Expand Down Expand Up @@ -3119,7 +3131,9 @@ H5T__conv_ullong__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata,
{
/* Suppress warning about non-standard floating-point literal suffix */
H5_GCC_CLANG_DIAG_OFF("pedantic")
H5_GCC_DIAG_OFF("c11-c23-compat")
H5T_CONV_Xf(ULLONG, FLOAT16, unsigned long long, H5__Float16, -FLT16_MAX, FLT16_MAX);
H5_GCC_DIAG_ON("c11-c23-compat")
H5_GCC_CLANG_DIAG_ON("pedantic")
}
#endif
Expand Down

0 comments on commit f230e3f

Please sign in to comment.