*ping* Re: [Patch, Fortran] PR48858/55465 - permit multiple bind(C) declarations (but not definitions) for the same proc

Tobias Burnus burnus@net-b.de
Mon May 20 18:29:00 GMT 2013


* PING *

Since today, due to a just committed patch, Open MPI (trunk version)  
won't compile with GCC 4.9 without this patch ...

Patches in this trilogy - the last one is required for Open MPI:
*http://gcc.gnu.org/ml/fortran/2013-05/msg00048.html  - COMMON
*http://gcc.gnu.org/ml/fortran/2013-05/msg00051.html  - PROCEDURE

* http://gcc.gnu.org/ml/fortran/2013-05/msg00056.html - more on bind 
label handling

On May 17, 2013 08:45, Tobias Burnus wrote:
> Followup (and depending on) to the C binding patches for
> * COMMON: http://gcc.gnu.org/ml/fortran/2013-05/msg00048.html
> * Procedures: http://gcc.gnu.org/ml/fortran/2013-05/msg00051.html
> which honour Fortran 2008, where the Fortran name is no longer a 
> global identifier if a binding name has been specified.
>
> The main reason for this patch is a build failure of Open MPI 
> (requires !gcc$ attributes no_arg_check, i.e. it only affects GCC 
> 4.9). Open MPI uses somethine like:
>   interface
>     subroutine pmpi_something() bind(C,name="MPI_something")
>   ...
> and in a different module:
>   interface
>     subroutine mpi_something() bind(C,name="MPI_something")
>   ...
>
> Currently, gfortran rejects it because it only permits one 
> definition/declaration per translation unit. However, there is no 
> reason why multiple INTERFACE blocks shouldn't be permitted.
>
>
> Remarks:
>
> a) Better argument checks if definition and declaration are in the 
> same file. (see INTENT patch in a test case)
>
> b) Currently, no check is done regarding the characteristic of 
> procedure declarations. Of course, the declaration has to be 
> compatible with the C procedure. However, there seems to be the wish* 
> to permit compatible input - even if the Fortran characteristic is 
> different. For instance "int *" takes both a scalar integer ("int i; 
> f(&i)") and arrays ("int i[5]; f(i)"). Or also popular according to 
> the PRs: Taking a C_LOC or an integer(c_intptr_t).
>
> (* Seemingly, also J3 and/or WG5 discussed this (plenum? subgroups?) 
> and they had the permit it. However, finding some official document is 
> difficult.)
>
> I was wondering for a while what should be permitted and what 
> shouldn't, but I have now decided to put that completely into the 
> hands of the user.
>
>
> Build and regtested on x86-64-gnu-linux.
> OK for the trunk?
>
> Tobias



More information about the Fortran mailing list