<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/162830>162830</a>
        </td>
    </tr>
    <tr>
        <th>Summary</th>
        <td>
            C23 mode: <float.h> missing FLT_SNAN macro
        </td>
    </tr>
    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>
    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>
    <tr>
      <th>Reporter</th>
      <td>
          tydeman
      </td>
    </tr>
</table>
<pre>
    This program:
#include <float.h>
int main(void){
  if(1){
    static float f = FLT_SNAN + FLT_SNAN;
  }
 return 0;
}
gets this error:
. /usr/bin/../lib/clang/20/share/msan_ignorelist.txt
. /usr/bin/../lib/clang/20/include/float.h
test190.c:4:22: error: use of undeclared identifier 'FLT_SNAN'
    4 |     static float f = FLT_SNAN + FLT_SNAN;
      |                      ^
test190.c:4:33: error: use of undeclared identifier 'FLT_SNAN'
    4 |     static float f = FLT_SNAN + FLT_SNAN;
      |                                 ^
2 errors generated.
The flags passed to clang are:
# flags common to both compiler and linker
export CLFLAGS="-g \
 -fsanitize=memory \
 -fsanitize=undefined \
 -fno-sanitize=float-cast-overflow \
 -fno-sanitize=float-divide-by-zero"
# -fsanitize=address added 2019/04/28 => kills compile; not w/ memory
# flags for compiler
export CFLAGS="-H -std=c23 -m64 -mfpmath=sse -msse2 -pedantic -O0 \
 -fno-fast-math \
 -fdenormal-fp-math=ieee \
 -fstrict-float-cast-overflow \
 -fmath-errno \
 -ftrapping-math \
 -ffp-contract=on \
 -fhonor-infinities \
 -fhonor-nans \
 -fsigned-zeros \
 -fno-associative-math \
 -fno-reciprocal-math \
 -fno-unsafe-math-optimizations \
 -fno-finite-math-only \
 -frounding-math \
 -ffp-model=strict \
 -ffp-exception-behavior=strict \
 -Xclang -disable-llvm-optzns ${INCS}"
This is on Intel x86_64 Core i5 running Fedora Linux 42.
clang -v gets as it first line:
clang version 20.1.8 (Fedora 20.1.8-4.fc42)
Aside:  If I use the older signaling NAN macro in <math.h> SNANF, the above code cannot be compiled for a different reason.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzMVk1v2zgT_jX0ZSCBpmRbPvjg2NX7Bgi6h_awt4ISh9JsKVIgKTfJr19QthM7LQrsntYwIGg-yGee-ZIMgTqLuGOrB7Y6LuQUe-d38UXhIO2icepl97WnAKN3nZcDK_aMz39RkG3NpBBYcdDGyZj3rPjE-J5shEGSZaI6OVJMbNnmgfE9AGkmquWNACBEGamF-QDQwIoj1E9fv335vP8MTDy8vbDi7ME2x_T0GCdvgZ_FZyHj-w5jgJjwovfOv6HNgYl6Cp6JuknA6jxnojbUMFG3RtqOiVpwJurQS49M1EOQ9ht11nk0FGIen-M_OeZCDRP1lRm-jxjicsvzlhX7khV7IVixf8MJU0BwGiarsDXSowJSaCNpQg9MbN6IEJsLdSWwzQH-DYnpd_X96cdWn36Btij-m2h_Ai7OIAN0aNHLiCo_18DXHkEb2QUYZQioIDqYkwYp5cWlqC8mrRsGZ5NJ42KfXkcy6EFaBYbsd_SM7_F5dD7C4al-2v_vCyuOTIisA7Y6JNyZDtJSpFdkxXHAwfmXX6oSh5osqnetddmNwUxU1soQM3dCr4378XtTRSdSmDUv2St6x4S4hHZ3rVTKYwgglUIFgi-3TNS8TBVcpZyw4hN8J2PCNXhWPIB1EX4wUcM5njvKtPNvPN2Qc8vN_yELUbHi2CY0w7qEbNDjIGPPimMICNkQAgrIRlTSpiLJ_uB3serEQnJ4lyq0zg_SZHrMLkcRIt5wHT21MfstjckxQ--te5dFL8eRbPfhPj1mrbPRyzay4ujsu6Z31vmMrKbEMoaPGivtjWwevGpOUbiLUYbgWpKRTvjhausyjy2N3rXS_KybbJD67JO5MdJArzKSs_fHz-iuVtbcFKV3k1W_DHhwCk3K0UzlnQqfWxzTLVmDvTxRmg8f7f4891mmKMjGYGbMaUgIXxM0UbLNw-Pnw5c0xc-1mpqVAlAAZ-HRRjTwXK2_rUs4OI9AK_CTtWQ7q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