Seek help with PR 33917 (PROCEDUREs)

Tobias Burnus burnus@net-b.de
Thu Nov 8 23:54:00 GMT 2007


Hi all,

using
  PROCEDURE(procedure_name) :: name
one can declare an (external) procedure, which uses the interface of
"procedure_name".

procedure_name has the following constrains:

"C1212 (R1215) The name shall be the name of an abstract interface or of a
procedure that has an explicit interface. If name is declared by a
procedure-declaration-stmt it shall be previously declared. If name denotes
an intrinsic procedure it shall be one that is listed in 13.6 and not
marked
with a bullet (.)"

The problem is that "procedure_name" cannot be resolved in decl.c as it
is unknown which contained procedures come later. Thus the interfaces
are resolved in resolve.c.

Now, I want to check for the restriction "If name is declared by a
procedure-declaration-stmt it shall be previously declared." But how? I
don't see any possibility in decl.c and for resolve.c, the order depends
on how the tree is walked, which is in general not the order in the file.

I was initially thinking of
  if(interface->attr.procedure
     && sym->declared [before] interface->declared) { error }
However, this does not work as the symbol interface of is resolved
before. Additionally, I don't know how to check for this condition,
especially in e.g. the following case, where everything is in one line:
 PROCEDURE(t) :: a; PROCEDURE(cos) :: t

Any idea?

Tobias



More information about the Fortran mailing list