[libc-commits] [libc] [libc] Provide isnan, isnanf and isnanl functions (PR #96008)

via libc-commits libc-commits at lists.llvm.org
Thu Jun 20 11:28:46 PDT 2024


enh-google wrote:

> C standard introduced `isnan` as a macro in C99, but it has been provided as a function long before that, originally by BSD but it was also adopted by glibc etc. It's fine to define both as long as the macro is defined after the function which is what glibc, bionic and newlib do. I'm inclined to do the same for backwards compatibility.

strictly, i don't think any of them (except bionic, for `isnan()` and `isinf()` only, not the f or l variants[1]) _declare_ the functions at all. there are just secret definitions, for backwards compatibility with a time when their macro turned into a call to one of the three (well, six) `__is*()` functions.

_____
1. and that seems like a mistake that i should fix by deletion.

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


More information about the libc-commits mailing list