Re: Does F90 do type checking when calling module subroutines?
- From: Richard E Maine <nospam@xxxxxxxxxxxxx>
- Date: Mon, 25 Apr 2005 15:59:05 -0700
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
.
- References:
- Does F90 do type checking when calling module subroutines?
- From: Neilen Marais
- Re: Does F90 do type checking when calling module subroutines?
- From: Ken Fairfield
- Does F90 do type checking when calling module subroutines?
- Prev by Date: Re: mixing logical with real in equation
- Next by Date: Re: ifort switches for mod files and line-number output
- Previous by thread: Re: Does F90 do type checking when calling module subroutines?
- Next by thread: Re: Does F90 do type checking when calling module subroutines?
- Index(es):
Relevant Pages
|