From murdoch.duncan at gmail.com  Tue Sep 30 14:59:40 2014
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Tue, 30 Sep 2014 08:59:40 -0400
Subject: [Rd] Intel Fortran compiler returns a -1 TRUE value
In-Reply-To: <CANVKczNY2JtHkf=0bcwdZOstwSBPaWCYVRWRkq3wOS7d33cjMA@mail.gmail.com>
References: <CANVKczM_RkKjX_8U62Zb4BG=afNin3t=bjMb+CJKLEv6O2U-DQ@mail.gmail.com>	<d78ed9a7be1e4540a70714bf81af0cd6@EX-0-HT0.lancs.local>
	<CANVKczNY2JtHkf=0bcwdZOstwSBPaWCYVRWRkq3wOS7d33cjMA@mail.gmail.com>
Message-ID: <542AA93C.8060808@gmail.com>

On 30/09/2014 8:39 AM, Barry Rowlingson wrote:
>
>
> On Tue, Sep 30, 2014 at 12:53 PM, Duncan Murdoch 
> <murdoch.duncan at gmail.com <mailto:murdoch.duncan at gmail.com>> wrote:
>
>
>     This appears to be user error.  According to Writing R Extensions, the
>     Fortran type corresponding to R logical is INTEGER, not LOGICAL.
>
>
> Oh yes, a very old and long-standing user error. I assume the CRAN 
> checks don't check this.

The checks can't really see that kind of thing:  they don't understand 
the external languages.  It's up to the user to follow the instructions 
in most cases.

> Has it ever been okay to pass logicals to Fortran?
>
It's okay to pass R logicals to Fortran (where they become INTEGER), 
it's just not okay to pass Fortran LOGICALs to R. The gcc Fortran 
compilers treat logicals the same as C does (i.e. 0 and 1 for FALSE and 
TRUE), but others don't, as you found out.

Duncan Murdoch

>  I shall inform the package maintainer....
>
> Thanks
>
> Barry
>



[Rd] Intel Fortran compiler returns a -1 TRUE value
Duncan Murdoch