(j3.2006) Is an explicit-shape array dummy argument with the VALUE attribute interoperable?

Bill Long longb
Wed Aug 19 14:46:49 EDT 2015


Suppose I have a Fortran BIND(C) subroutine, fsub, with a dummy argument that is an explicit-shape array of type integer(c_int) with the VALUE attribute.  What would the corresponding C prototype look like?   How would a C function call fsub  (which, from the C compiler?s point of view, is just another C function) ?    If you can?t make that work, then the scheme fails the requirements for the Fortran interface and the C prototype being interoperable.

Cheers,
Bill

 
On Aug 19, 2015, at 12:37 PM, Daniel C Chen <cdchen at ca.ibm.com> wrote:

> Hello,
> 
> The standard allows an explicit-shape array dummy argument to have the VALUE attribute, but it doesn't explicitly say if such a dummy argument is interoperable or not. 
> 
> I found the following in 15-007r1:
> 
> "A Fortran procedure interface is interoperable with a C function prototype if
> ...
> 
> [461:12] "(4) any scalar dummy argument with the VALUE attribute is interoperable with the corresponding formal parameter of the prototype,
> 
> ..."
> 
> Should this be relaxed to remove the word "scalar"?
> 
> Thanks,
> 
> Daniel
> 
> XL Fortran Development - IBM Toronto Software Lab
> Phone: 905-413-3056 
> Tie: 969-3056 
> Email: cdchen at ca.ibm.com
> http://www.ibm.com/software/awdtools/fortran/xlfortran
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3

Bill Long                                                                       longb at cray.com
Fortran Technical Support  &                                  voice:  651-605-9024
Bioinformatics Software Development                     fax:  651-605-9142
Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101





More information about the J3 mailing list