[MPI3 Fortran] Fwd: [Mpi-comments] MPI 3.0: Fortran 2008 interface - issue with the LOGICAL kind

N.M. Maclaren nmm1 at cam.ac.uk
Thu Feb 28 13:47:56 CST 2013


On Feb 28 2013, Craig Rasmussen wrote:
>> 
>> (3) Or one forces the compiler to accept also other values than 
>> .true./.false. As with the previous item, it will affect also all 
>> non-Bind(C) logicals. And C_Bool should presumably excluded as one 
>> otherwise might get in trouble with the C compiler.
>
> It seems it has to anyway to be compatible with C. I don't have the C99 
> standard but it appears that there isn't a constant for "true" and 
> "false" without including stdbool.h. Thus a Fortran compiler will have to 
> anticipate values other than .true./.false.

true and false are specified to be 1 and zero in stdbool.h.

>> (4) Last, handling dummy arguments/result variables of BIND(C) 
>> procedures differently. That probably would work, but it requires a 
>> bunch of the careful addition of additional constraints. For instance, 
>> to prohibit the TARGET/POINTER attribute for those.
>
> To me this is the only sane response given that C evaluates 0 to false 
> and everything else to true. Nick you want to weigh in on the C standard.

Tempting, but no.  I will say that I can see no reason to prohibit
the TARGET/POINTER attribute according to whether BIND(C) is there.


Regards,
Nick Maclaren.




More information about the mpiwg-fortran mailing list