Passing module procedures to external procedures -- type issues
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.fortran Profile…
 Up
Passing module procedures to external procedures -- type issues         


Author: Rich Townsend
Date: Sep 19, 2008 18:52

Hi all --

Consider the following module:

---CUT---
module foo

implicit none

contains

subroutine main_sub ()

call internal_sub()

contains

subroutine internal_sub()

call QAG(other_sub)

end subroutine internal_sub

end subroutine main_sub

subroutine other_sub ()

end subroutine other_sub

end module foo
---CUT---
Show full article (0.98Kb)
12 Comments
Re: Passing module procedures to external procedures -- type issues         


Author: glen herrmannsfeldt
Date: Sep 19, 2008 21:15

Rich Townsend wrote:
> module foo
> implicit none
> contains
> subroutine main_sub
> call internal_sub()
> contains
> subroutine internal_sub()
> call QAG(other_sub)
> end subroutine internal_sub
> end subroutine main_sub
> subroutine other_sub ()
> end subroutine other_sub
> end module foo

No error from g95, either.
> This compiles fine with Intel Fortran (Linux), but on gfortran 4.3.1, I
> get the following error:
> Error: Symbol 'other_sub' at (1) has no IMPLICIT type
Show full article (1.08Kb)
no comments
Re: Passing module procedures to external procedures -- type issues         


Author: robert.corbett
Date: Sep 19, 2008 22:06

On Sep 19, 6:52 pm, Rich Townsend barVOIDtol.udel.edu> wrote:
> Hi all --
>
> Consider the following module:
>
> ---CUT---
> module foo
>
> implicit none
>
> contains
>
> subroutine main_sub ()
>
> call internal_sub()
>
> contains
>
> subroutine internal_sub()
> ...
Show full article (1.38Kb)
no comments
Re: Passing module procedures to external procedures -- type issues         


Author: robert.corbett
Date: Sep 19, 2008 22:14

On Sep 19, 10:06 pm, robert.corb...@sun.com wrote:
> On Sep 19, 6:52 pm, Rich Townsend barVOIDtol.udel.edu> wrote:
>
>
>
>> Hi all --
>
>> Consider the following module:
>
>> ---CUT---
>> module foo
>
>> implicit none
>
>> contains
>
>> subroutine main_sub ()
>
>> call internal_sub()
> ...
Show full article (1.52Kb)
no comments
Re: Passing module procedures to external procedures -- type issues         


Author: robert.corbett
Date: Sep 19, 2008 22:16

On Sep 19, 10:06 pm, robert.corb...@sun.com wrote:
> On Sep 19, 6:52 pm, Rich Townsend barVOIDtol.udel.edu> wrote:
>
>
>
>> Hi all --
>
>> Consider the following module:
>
>> ---CUT---
>> module foo
>
>> implicit none
>
>> contains
>
>> subroutine main_sub ()
>
>> call internal_sub()
> ...
Show full article (1.64Kb)
no comments
Re: Passing module procedures to external procedures -- type issues         


Author: nospam
Date: Sep 19, 2008 23:25

> On Sep 19, 6:52 pm, Rich Townsend barVOIDtol.udel.edu> wrote:
Show full article (2.90Kb)
no comments
Re: Passing module procedures to external procedures -- type issues         


Author: paul.richard.thomas
Date: Sep 21, 2008 12:39

Tobias Burnus posted this as PR35597 and I just confirmed it.

Thanks for the report.... maybe next time in Bugzilla? :-)

Cheers

Paul
no comments
Re: Passing module procedures to external procedures -- type issues         


Author: stevenb.gcc
Date: Sep 21, 2008 16:11

On Sep 21, 9:39 pm, paul.richard.tho...@gmail.com wrote:
> Tobias Burnus posted this as PR35597 and I just confirmed it.

Actually, http://gcc.gnu.org/PR37597

Note the 37xxx. The number of reported bugs (including enhancement,
and for all of gcc) is close to 8000 per year ;-)

Gr.
Steven
no comments
Re: Passing module procedures to external procedures -- type issues         


Author: glen herrmannsfeldt
Date: Sep 22, 2008 15:09

Rich Townsend wrote:
> module foo
> implicit none
> contains
> subroutine main_sub ()
> call internal_sub()
> contains
> subroutine internal_sub()
call QAG(other_sub)
> end subroutine internal_sub
> end subroutine main_sub
> subroutine other_sub ()
> end subroutine other_sub
> end module foo
(snip)
> call QAG(other_sub)
> 1
> Error: Symbol 'other_sub' at (1) has no IMPLICIT type
Show full article (1.01Kb)
no comments
Re: Passing module procedures to external procedures -- type issues         


Author: glen herrmannsfeldt
Date: Sep 22, 2008 20:47

Richard Maine wrote:
(snip)
> I even recall a particular name having been mentioned as someone who
> vehemently opposed requiring compilers to figure out such forward
> references. She evidently lost the argument. I'll not repeat the name
> (except insomuch as the gender narrows it down a bit; there have been
> quite a few females on the committee, but they were still enough of a
> minority that it narrows it down considerably.)

In the case where a compiler might have to go a few lines
down to find out the needed information, it isn't so bad.
(Often true for Fortran declaration statements.)

In this case, if each subroutine contained thousands
of lines it could be a long way down. Not good at all
if you want to write a one pass compiler.

In the case of IMPLICIT NONE, is this an implicit
declaration of other_sub?

-- glen
no comments
1 2