Eric Botcazou <[EMAIL PROTECTED]> writes:
>> Why does the compilation of b.c fail, while that of a.c succeeds with
>> gcc-4.0.0 or later?
>
> Because the call to isinf is optimized away even at -O0 in the latter case
> (isinf being a pure function), but not in the former. That could be deemed
> a little questionable though. The gap is eliminated at -O1.
Thank you for explication. Is it gcc's expected behavior?
The configure script which is included in rrdtool[1] checks whether
the system has isinf() as below.
#include <math.h>
int
main ()
{
float f = 0.0; isinf(f)
;
return 0;
}
If above compilation is success, the configure script defines
HAVE_ISINF macro. The prior version to gcc-4.0.0 above compilation
fails, so below isinf macro is defined. But gcc-4.0.0 or later it
succeeds, so below isinf macro is not defind though the system doesn't
have isinf().
/* Solaris */
#if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS))
# define HAVE_ISINF 1
# define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF)
#endif
Is this gcc's problem? Or should I contact rrdtool's developer?
Regards.
[1] <URL:http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/>
--
Hiroshi Fujishima