<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 15, 2008, at 9:07 PM, Jim Xia wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><tt><font size="2"><a href="mailto:j3-bounces@j3-fortran.org">j3-bounces@j3-fortran.org</a> wrote on 09/15/2008 07:27:29 PM:<br> <br> <br> > Aleksandar Donev wrote:<br> > > On Monday 15 September 2008 16:17, Bill Long wrote:<br> > > &nbsp; <br> > > What Craig is taking about is the case when default integer and C_INT are <br> > > different (e.g., -i8). Then the existing MPI interface passes default <br> > > integers even though the underlying implementation wants C ints. So you <br> > > either need wrappers or you need to change the interface (and thus codes).<br> > > Aleks<br> > > &nbsp; <br> > <br> > Or, the user needs to explicitly specify the kinds for the arguments, <br> > overriding the effect of -i8. &nbsp;This is the usual and recommended <br> > solution for this problem. &nbsp;Since the interface is explicit, failure to <br> > do this will give error messages that 'remind' the user to fix the problem.<br> > <br> </font></tt> <br><tt><font size="2">In C's calling-by-value convention, there is an implicit conversion on the caller site to match the explicit interface. &nbsp;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. &nbsp;This is a quite useful feature in C that lacks in Fortran's VALUE attribute. &nbsp;We may consider to add this to Fortran C-interop TR.</font></tt> <br><font class="Apple-style-span" face="-webkit-monospace" size="1"><span class="Apple-style-span" style="font-size: 9px;"><br></span></font></blockquote><br></div><div>I also think this would be a useful feature for the TR. &nbsp;This would allow the compiler to issue a warning if there is a kind conversion rather than an error. Passing by value is fundamentally different from reference semantics. &nbsp;Fortran allows assignment between types with different kind values. &nbsp;Passing by value seems to me to be like assignment. &nbsp;However, this is not a big deal for MPI, since it looks like we will need wrapper functions anyway, the conversion can be done within the wrapper. &nbsp;I rather do the conversion that blow up the interfaces with multiple kind parameters.</div><div><br></div><div>Regards,</div><div>Craig</div><div><br></div></body></html>