[all-commits] [llvm/llvm-project] 62c352: [CLANG] Fix INF/NAN warning. (#80290)

Zahira Ammarguellat via All-commits all-commits at lists.llvm.org
Tue Feb 6 06:23:34 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 62c352e13c145b5606ace88ecbe9164ff011b5cf
      https://github.com/llvm/llvm-project/commit/62c352e13c145b5606ace88ecbe9164ff011b5cf
  Author: Zahira Ammarguellat <zahira.ammarguellat at intel.com>
  Date:   2024-02-06 (Tue, 06 Feb 2024)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticCommonKinds.td
    M clang/include/clang/Basic/DiagnosticDocs.td
    M clang/include/clang/Lex/Preprocessor.h
    M clang/lib/Lex/PPDirectives.cpp
    M clang/lib/Lex/PPExpressions.cpp
    M clang/test/Sema/warn-infinity-nan-disabled-lnx.cpp
    M clang/test/Sema/warn-infinity-nan-disabled-win.cpp

  Log Message:
  -----------
  [CLANG] Fix INF/NAN warning. (#80290)

In https://github.com/llvm/llvm-project/pull/76873 a warning was added
when the macros INFINITY and NAN are used in binary expressions when
-menable-no-nans or -menable-no-infs are used. If the user uses an
option that nullifies these two options, the warning will still be
generated. This patch adds an additional information to the warning
comment to let the user know about this. It also suppresses the warning
when #ifdef INFINITY, #ifdef NAN, #ifdef NAN or #ifndef NAN are used in
the code.




More information about the All-commits mailing list