rfc: multiple decls for functions

Dominique Dhumieres dominiq@lps.ens.fr
Fri Dec 19 22:15:00 GMT 2008


Daniel,

I think this issue has already been discussed in the past although
I don't know how to find the thread. I think there was a bug in gfortran that
has been fixed. I have added some content to one of your test to get:

MODULE m
CONTAINS
  SUBROUTINE f()
    CALL g()
  CONTAINS
    SUBROUTINE g()
      print *, 'contained'
    END SUBROUTINE
  END SUBROUTINE
  SUBROUTINE g()      ! G was declared before F in the previous example
    print *, 'module'
  END SUBROUTINE
END MODULE
use m
call g()
call f()
call g()
end

The executable gives:

 module
 contained
 module

and If i remember correctly, this is the right answer. I don't know if I'll
use the right wording, but the first g being define is the f scope is called
within f, while the g called from outside f are the second one.

Too bad Tobias is not listening, because he ceetainly remember the discussion
(may be it came to the comp.lang.fortran list).

Dominique



More information about the Fortran mailing list