You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[CLANG] Emit warning in finite math mode when INF and NAN are used. (#99672)
In finite math mode when special math builtins `__builtin_inf` and
`__builtin_nan` are used a warning is emitted when the builtin is
expanded and at call point.
This warning at call point was missing for` __builtin_inf` and this
patch fixes the issue
(#98018).
Copy file name to clipboardExpand all lines: clang/test/Headers/float.c
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -223,8 +223,9 @@
223
223
#ifndefNAN
224
224
#error "Mandatory macro NAN is missing."
225
225
#endif
226
-
// FIXME: the NAN diagnostic should only be issued once, not twice.
227
-
_Static_assert(_Generic(INFINITY, float : 1, default : 0), ""); // finite-warning {{use of infinity via a macro is undefined behavior due to the currently enabled floating-point options}}
226
+
// FIXME: the NAN and INF diagnostics should only be issued once, not twice.
227
+
_Static_assert(_Generic(INFINITY, float : 1, default : 0), ""); // finite-warning {{use of infinity via a macro is undefined behavior due to the currently enabled floating-point options}} \
228
+
finite-warning {{use of infinity is undefined behavior due to the currently enabled floating-point options}}
228
229
_Static_assert(_Generic(NAN, float : 1, default : 0), ""); // finite-warning {{use of NaN is undefined behavior due to the currently enabled floating-point options}} \
229
230
finite-warning {{use of NaN via a macro is undefined behavior due to the currently enabled floating-point options}}
0 commit comments