CURRENT: CLANG 3.3 and -stad=c++11 and -stdlib=libc++: isnan()/isninf() oddity

David Chisnall theraven at
Thu Jul 11 14:33:44 UTC 2013

On 11 Jul 2013, at 13:11, Bruce Evans <brde at> wrote:

> The error message for the __builtin_isnan() version is slightly better up
> to where it says more.
> The less-unportable macro can do more classification and detect problems
> at compile time using __typeof().

The attached patch fixes the related test cases in the libc++ test suite.  Please review.

This does not use __builtin_isnan(), but it does:

- Stop exposing isnan and isinf in the header.  We already have __isinf in libc, so this is used instead.

- Call the static functions for isnan __inline__isnan*() so that they don't conflict with the ones in libm.

- Add an __fp_type_select() macro that uses either __Generic(), __builtin_choose_expr() / __builtin_choose_expr(), or sizeof() comparisons, depending on what the compiler supports.

- Refactor all of the type-generic macros to use __fp_type_select().  


-------------- next part --------------
A non-text attachment was scrubbed...
Name: isnan.diff
Type: application/octet-stream
Size: 3829 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 881 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <>

More information about the freebsd-standards mailing list