[clang-tools-extra] [llvm] [clang] [CLANG] Add warning when INF or NAN are used in a binary operation or as function argument in fast math mode. (PR #76873)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 24 01:23:38 PST 2024


mikaelholmen wrote:

Hello,

It seems like with this change it warns like
```
w.c:1:10: warning: use of infinity via a macro is undefined behavior due to the currently enabled floating-point options [-Wnan-infinity-disabled]
    1 | # ifndef INFINITY
      |          ^
1 warning generated.
```
with
```
clang w.c -c -ffast-math
```
on input like
```
# ifndef INFINITY

# endif
```
Is this expected and wanted?


https://github.com/llvm/llvm-project/pull/76873


More information about the cfe-commits mailing list