From ripley at stats.ox.ac.uk  Sat Apr  2 19:37:54 2005
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sat Apr  2 19:38:10 2005
Subject: [Rd] Solaris10/amd64 + SunSutio Compile (PR#7767)
In-Reply-To: <x2mzshxhcr.fsf@turmalin.kubism.ku.dk>
References: <20050402162404.15C6AC74E@slim.kubism.ku.dk>
	<x2mzshxhcr.fsf@turmalin.kubism.ku.dk>
Message-ID: <Pine.LNX.4.61.0504021821200.24678@gannet.stats>

On Sat, 2 Apr 2005, Peter Dalgaard wrote:

> teru@sodan.ecc.u-tokyo.ac.jp writes:
>
>> Full_Name: Teru KAMOGASHRIA
>> Version: 2.0.1
>> OS: SunOS sun 5.10 Generic i86pc i386 i86pc
>> Submission from: (NULL) (219.5.176.24)
>>
>>
>> rbinom.c cannot be compiled because of the casting problem.
>>
>> /opt/SUNWspro/bin/cc -I. -I../../src/include -I../../src/include
>> -I/usr/local/include -DHAVE_CONFIG_H -D__NO_MATH_INLINES  -g -c rbinom.c -o
>> rbinom.o
>> "rbinom.c", line 60: operand must have real floating type: op "isfinite"
>> cc: acomp failed for rbinom.c
>>
>> Following patch may solve this problem.
>>
>> *** R-2.0.1.orig/src/nmath/rbinom.c     Mon Nov 15 21:33:01 2004
>> --- R-2.0.1/src/nmath/rbinom.c  Sun Apr  3 00:19:52 2005
>> ***************
>> *** 57,63 ****
>>       n = floor(nin + 0.5);
>>       if (n != nin) ML_ERR_return_NAN;
>>
>> !     if (!R_FINITE(n) || !R_FINITE(pp) ||
>>         /* n=0, p=0, p=1 are not errors <TSL>*/
>>         n < 0 || pp < 0. || pp > 1.)    ML_ERR_return_NAN;
>>
>> --- 57,63 ----
>>       n = floor(nin + 0.5);
>>       if (n != nin) ML_ERR_return_NAN;
>>
>> !     if (!R_FINITE((double)n) || !R_FINITE(pp) ||
>>         /* n=0, p=0, p=1 are not errors <TSL>*/
>>         n < 0 || pp < 0. || pp > 1.)    ML_ERR_return_NAN;
>
> Hmm... But does it at all make sense to pass an integer to R_FINITE?

Dunno.  It was in the original (r574 code), with finite rather than 
R_FINITE.  It would make sense to test nin (rather than n).

> and why isn't there a prototype causing automatic casting anyway?

Because isfinite is a macro.  (Solaris 10 is rather new, which is probably 
why we have not seen this before.  We received our CDs last week.)

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] Solaris10/amd64 + SunSutio Compile (PR#7767)
Prof Brian Ripley