--- Comment #12 from pinskia at gcc dot gnu dot org 2006-04-05 07:25
---
(In reply to comment #11)
> (In reply to comment #7)
> > I don't think this is defined code:
> > if (present (a)) call abort ()
> > call foo_ (a)
> > If a is not present, you should not be able to use a in
--- Comment #11 from paul dot richard dot thomas at cea dot fr 2006-04-05
07:17 ---
(In reply to comment #7)
> I don't think this is defined code:
> if (present (a)) call abort ()
> call foo_ (a)
> If a is not present, you should not be able to use a in any way.
Not quite; as I
--- Comment #10 from paul dot richard dot thomas at cea dot fr 2006-04-05
07:02 ---
> program main
> call foo (5)
> end program main
> subroutine foo(n, a)
> integer :: n
> integer, dimension(5), optional :: a
> print *, n
> if (present (a)) call abort ()
> end subroutine foo
--- Comment #9 from hjl at lucon dot org 2006-04-05 00:40 ---
>From section 12.7.5, Fortran 95 Handbook:
A dummy argument not present may be supplied as an actual argument
corresponding
to an optional dummy argument.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27035
--- Comment #8 from pinskia at gcc dot gnu dot org 2006-04-04 23:40 ---
From
http://www.sesp.cse.clrc.ac.uk/Publications/felib90_design/design/node6.html
Because of the nature and implementation of optional arguments in Fortran 90/95
the head of most routines has a group of code dealing
--- Comment #7 from pinskia at gcc dot gnu dot org 2006-04-04 23:37 ---
I don't think this is defined code:
if (present (a)) call abort ()
call foo_ (a)
If a is not present, you should not be able to use a in any way.
--
pinskia at gcc dot gnu dot org changed:
W
--- Comment #6 from hjl at lucon dot org 2006-04-04 23:34 ---
Tonto uses it and I got a run-time failure.
--
hjl at lucon dot org changed:
What|Removed |Added
OtherBugsDep
--- Comment #5 from hjl at lucon dot org 2006-04-04 23:28 ---
[EMAIL PROTECTED] cpu2006-465e]$ cat mod.f90
module mod
implicit none
private
public bar_
interface bar_
module procedure bar
end interface
public foo_
interface foo_
module procedure foo
end interface
contains
subrouti
--- Comment #4 from pinskia at gcc dot gnu dot org 2006-04-04 22:19 ---
You can also fix the code by using modules and what is basicially prototypes (I
forgot the Fortran name for them).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27035
--- Comment #3 from pinskia at gcc dot gnu dot org 2006-04-04 22:18 ---
Lehay's testcase can be found at:
http://www.lahey.com/check.htm
It is free to use, kinda like Comeau's C/C++ tester.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27035
--- Comment #2 from pinskia at gcc dot gnu dot org 2006-04-04 22:16 ---
With the fixed code:
program main
call foo (5)
contains
subroutine foo(n, a)
integer :: n
integer, dimension(5), optional :: a
print *, n
if (present (a)) call abort ()
end subroutine foo
end program main
--- Comment #1 from pinskia at gcc dot gnu dot org 2006-04-04 22:13 ---
First off I think the code below is invalid code.
I get with Lahey's F95 online compiler:
2602-S: "SOURCE.F90", line 5: The argument number of procedure 'foo' shall be
the same between definition and reference. The
12 matches
Mail list logo