[libcxx-commits] [libcxx] [libcxx] Undefine all supported C math functions (PR #94533)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 5 16:58:57 PDT 2024


PiJoules wrote:

Looking at isnan as an example, it looks like `isnan` was a macro that resolved to just `__builtin_isnan` from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__math/traits.h, hence
```
/home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/cmath:582:10: error: no member named '__builtin_isnan' in namespace 'std'; did you mean simply '__builtin_isnan'?
  582 |   return std::isnan(__lcpp_x);
      |          ^~~~~
/home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__math/traits.h:97:10: note: '__builtin_isnan' declared here
   97 |   return __builtin_isnan(__x);
      |          ^
```
Locally, mine is defined as
```
#  define isnan(x) \
     (sizeof (x) == sizeof (float) ? __isnanf (x) : __isnan (x))
```
So the macros are still being used it seems.

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


More information about the libcxx-commits mailing list