[PATCH] D60220: [CUDA][Windows] Final fix for bug 38811 (Step 3 of 3)

Dimitry Andric via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 29 10:17:20 PDT 2019


dim added a comment.

Hm, I would really say that `__isnan` and the other `__` prefixed functions are Linuxisms, or more accurately, glibc-isms.  They also don't exist on e.g. macOS:

  $ cat check-isnan.cpp
  #include <math.h>
  
  int check_isnan(double d)
  {
    return ::__isnan(d);
  }
  
  $ clang -v
  Apple clang version 11.0.0 (clang-1100.0.33.8)
  Target: x86_64-apple-darwin18.7.0
  Thread model: posix
  InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  
  $ clang -c check-isnan.cpp
  check-isnan.cpp:5:12: error: no member named '__isnan' in the global namespace; did you mean 'isnan'?
    return ::__isnan(d);
           ~~^~~~~~~
             isnan
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/math.h:519:1: note: 'isnan' declared here
  isnan(_A1 __lcpp_x) _NOEXCEPT
  ^
  1 error generated.

Why can't the regular `isnan` be used instead?  Or is this a CUDA-specific requirement?  (Apologies, but I know next to nothing about CUDA :) )


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60220/new/

https://reviews.llvm.org/D60220





More information about the cfe-commits mailing list