(j3.2006) kind conversion for intent(in), value dummy arguments

Van Snyder Van.Snyder
Tue Sep 16 14:07:37 EDT 2008


On Mon, 2008-09-15 at 23:07 -0400, Jim Xia wrote:
> 
> j3-bounces at j3-fortran.org wrote on 09/15/2008 07:27:29 PM:
> 
> 
> > Aleksandar Donev wrote:
> > > On Monday 15 September 2008 16:17, Bill Long wrote:
> > >   
> > > What Craig is taking about is the case when default integer and
> > > C_INT are different (e.g., -i8). Then the existing MPI interface
> > > passes default integers even though the underlying implementation
> > > wants C ints. So you either need wrappers or you need to change
> > > the interface (and thus codes).
> > > Aleks
> > >   
> > 
> > Or, the user needs to explicitly specify the kinds for the
> > arguments, overriding the effect of -i8.  This is the usual and
> > recommended solution for this problem.  Since the interface is
> > explicit, failure to do this will give error messages that 'remind'
> > the user to fix the problem. 
> 
> In C's calling-by-value convention, there is an implicit conversion on
> the caller site to match the explicit interface.  So even the user
> uses a different kind value (say int vs long long int), the compiler
> makes sure on the caller site, the conversion happens.  This is a
> quite useful feature in C that lacks in Fortran's VALUE attribute.  We
> may consider to add this to Fortran C-interop TR. 

If we do this at all, it should be a general feature of the VALUE
attribute, not some wart stuck on C interop.  It ought to be defined in
terms of assignment, probably including defined assignment.

> Cheers, 
> 
> Jim Xia
> 
> RL Fortran Compiler Test
> IBM Toronto Lab at 8200 Warden Ave, Markham, On, L6G 1C7
> Phone (905) 413-3444  Tie-line 313-3444
> email: jimxia at ca.ibm.com
> D2/YF7/8200 /MKM 
> _______________________________________________
> J3 mailing list
> J3 at j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3




More information about the J3 mailing list