http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54107



--- Comment #19 from janus at gcc dot gnu.org 2013-01-27 09:22:56 UTC ---

(In reply to comment #17)

> (In reply to comment #14)

> > > Are procedure dummy arguments mutually exclusive with non-NULL procedure

> > > interface, so that there is no dummy ambiguity in the array spec and char

> > > length?

> > 

> > I'm not sure I understand the question. You can certainly declare dummy

> > procedures with the PROCEDURE statement (so that they get a ts.interface).

> > Still, I don't see how this could create ambiguities with the as or cl. Or 
> > are

> > you talking about something like this:

> > 

> > procedure(some_interface) :: proc

> > integer(4) :: proc

> > 

> No, I was thinking of C-like forward declaration:

> 

> interface

>   function some_interface(ifc_arg)

>      [...]

> end interface

> 

> procedure(some_interface) :: proc

> 

> [...]

> 

> ! Now the actual function

> function proc (arg)

> [...]

> 

> 

> That doesn't feel right this way



Well, I guess whether this is legal Fortran or not depends a bit on what the

second [...] is supposed to be. If there is something like an END PROGRAM or

END MODULE in there, then your PROCEDURE statement simply amounts to an

external declaration of 'proc' and everything is fine.



If the second [...] is rather something like a CONTAINS, however, then your

code is illegal, since you specify the interface twice in the same program unit

(gfortran reports this error properly).





> but I was wondering whether there was a way

> for a procedure like `proc' above to have dummy arguments both directly 
> (`arg')

> and through the interface (`ifc_arg').



No, I don't think this is possible (see above reasoning). Certainly every

procedure is supposed to have a uniquely determined interface.

Reply via email to