chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] llvm-gcc / clang


From: Felix
Subject: Re: [Chicken-users] llvm-gcc / clang
Date: Fri, 03 Dec 2010 03:30:21 -0500 (EST)

From: Thomas Chust <address@hidden>
Subject: Re: [Chicken-users] llvm-gcc / clang
Date: Thu, 2 Dec 2010 16:16:21 +0100

> 2010/12/1 Felix <address@hidden>:
>> [...]
>> Oh, and clang gave me stupid warnings that where actually wrong
>> (an "x == x" comparison of floats to detect NaN, which is IMHO
>> totally correct, triggers a warning - but I'm sure John can give
>> us the correct interpretation of the standard C semantics).
>> [...]
> 
> Hello Felix,
> 
> what about using
> 
>   #include <math.h>
>   [...]
>   if (isnan(x)) ...
> 
> or maybe
> 
>   [...]
>   if (fpclassify(x) == FP_NAN) ...
> 
> instead of a comparison? I would expect the compiler to inline these
> calls and produce equally efficient code as for a comparison operation
> and it might be a bit more portable to do it this way.
> 

Yes, these are nice. I just have to make sure they are available on
all platforms and what macros have to be defined (_XOPEN_SOURCE,
_ISOC99_SOURCE), which is always a bit of a hassle.


cheers,
felix



reply via email to

[Prev in Thread] Current Thread [Next in Thread]