[clang] [C23] Add *_NORM_MAX macros to <float.h> (PR #96643)
Zahira Ammarguellat via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 25 13:58:12 PDT 2024
================
@@ -207,6 +211,23 @@
#error "Mandatory macros {FLT,DBL,LDBL}_MAX_10_EXP are invalid."
#endif
+#if __STDC_VERSION__ >= 202311L || !defined(__STRICT_ANSI__)
+#ifndef FLT_NORM_MAX
+ #error "Mandatory macro FLT_NORM_MAX is missing."
+#else
+ _Static_assert(FLT_NORM_MAX >= 1.0E+37F, "Mandatory macro FLT_NORM_MAX is invalid.");
+#endif
+#ifndef DBL_NORM_MAX
+ #error "Mandatory macro DBL_NORM_MAX is missing."
+#else
+ _Static_assert(DBL_NORM_MAX >= 1.0E+37F, "Mandatory macro DBL_NORM_MAX is invalid.");
+#endif
+#ifndef LDBL_NORM_MAX
+ #error "Mandatory macro LDBL_NORM_MAX is missing."
+#else
+ _Static_assert(LDBL_NORM_MAX >= 1.0E+37F, "Mandatory macro LDBL_NORM_MAX is invalid.");
+#endif
+#endif
----------------
zahiraam wrote:
Did you mean here for the condition of `_Static_assert` to compare the macro to the same value ` 1.0E+37F`?
https://github.com/llvm/llvm-project/pull/96643
More information about the cfe-commits
mailing list