Re: Does F90 do type checking when calling module subroutines?



In article <d4jntd$grb$1@xxxxxxxxxxxxxxxx>,
Ken Fairfield <my.full.name@xxxxxxxxx> wrote:

> It is important that the "USE parseinput" statement be present in
> *every* subroutine or function, or the main program, that calls
> read_namelists.

Hmm. Good point. Very good point. Well, it doesn't have to be in every
subroutine, but it does have to be accessible (for example, it is fine
for the USE to be in a module - that will work for all the subroutines
in the module).

If the USE isn't in the subroutine (or its host), then the compiler ends
up assuming that read_namelists is an external procedure and it doesn't
get checked. That does tend to generate a linker error, but not a
compiler one.

Another fairly common error variant is to mistakenly have an EXTERNAL
statement for read_namelists; that will do a "nice" job of blocking the
host association.

At times I have wished for something similar to "implicit none" for
procedure interfaces - a statement that I think every procedure I'm
using should have an explicit interface, so bitch at me if one doesn't.

--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain | experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
.



Relevant Pages

  • Re: Modules and User Supplied Subroutine
    ... where aSubroutine is a user supplied subroutine. ... is to an external procedure with that name. ... the standard requires the external ... What does the standard say about linking in general? ...
    (comp.lang.fortran)
  • Re: Modules and User Supplied Subroutine
    ... where aSubroutine is a user supplied subroutine. ... is to an external procedure with that name. ... the standard requires the external ... a Fortran processor can require that there be an ...
    (comp.lang.fortran)
  • Re: Modules and User Supplied Subroutine
    ... where aSubroutine is a user supplied subroutine. ... If and do not apply, the reference ... is to an external procedure with that name. ... and so a Fortran processor is not required to note ...
    (comp.lang.fortran)