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

From: David Chisnall <theraven_at_FreeBSD.org>
Date: Thu, 11 Jul 2013 15:33:34 +0100
On 11 Jul 2013, at 13:11, Bruce Evans <brde_at_optusnet.com.au> 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().  

David



Received on Thu Jul 11 2013 - 12:33:44 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:39 UTC