[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] llvm-gcc / clang
From: |
Thomas Chust |
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.
Ciao,
Thomas
--
When C++ is your hammer, every problem looks like your thumb.