--- Comment #10 from burnus at gcc dot gnu dot org 2007-06-01 15:21 ---
As gfortran seems to do everything as required by the Fortran standard (or at
least other compilers do the same ;-), this no bug.
It it only missing whole-file interface checking. As this enhancement is
tracked in P
--- Comment #9 from burnus at gcc dot gnu dot org 2007-06-01 11:36 ---
> Indeed, the compiler should report an error ; but it is just an improvement.
> Still much to learn about Fortran ;)
In Fortran, subroutines and functions in the same file have nothing to do with
each another if the
--- Comment #8 from mikael dot morin at tele2 dot fr 2007-06-01 10:57
---
Ok, placing the function in a contains statement still reproduces the bug with
4.1.2, but doesn't compile with 4.3, complaining about the wrong size
of the string arguments.
And using variable size strings (len=*
--- Comment #7 from dominiq at lps dot ens dot fr 2007-05-31 19:38 ---
subroutine test(chars)
character(len=*), dimension(2) :: chars
write(6,*) chars
end subroutine
for the code in comment #2.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32170
--- Comment #6 from dominiq at lps dot ens dot fr 2007-05-31 19:34 ---
In the code in comment #4, you should use:
subroutine test(chars)
character(len=*) :: chars
write(6,*) chars
end subroutine
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32170
--- Comment #5 from dominiq at lps dot ens dot fr 2007-05-31 19:33 ---
Compiled with g95, the code in comment #3 gives
In file pr32170_2.f90:10
call test( (/ "string1", "string2" /) )
In file pr32170_2.f90:16
subroutine test(chars)
2
Error: Passing ar
--- Comment #4 from mikael dot morin at tele2 dot fr 2007-05-31 19:26
---
$ export FILE=test6
$ cat $FILE.f
program testchar
character(len=30) :: str2
write(str2,*) "string1"
call test( str2 )
call test("string2")
--- Comment #3 from mikael dot morin at tele2 dot fr 2007-05-31 19:18
---
$ export FILE=test3
$ cat $FILE.f
program testchar
character(len=30), dimension(2) :: str2
write(str2(1),*) "string1"
write(str2(2),*) "string2"
ca
--- Comment #2 from mikael dot morin at tele2 dot fr 2007-05-31 19:04
---
$ export FILE=test2
$ cat $FILE.f
program testchar
character(len=30), dimension(2) :: str2
write(str2(1),*) "string1"
write(str2(2),*) "string2"
--- Comment #1 from mikael dot morin at tele2 dot fr 2007-05-31 19:00
---
$ export FILE=test
$ cat $FILE.f
program testchar
character(len=30), dimension(2) :: str1, str2
str1 = (/ "string1", "string2" /)
write(6,*) str1
write(str2(1),*) "string1"
10 matches
Mail list logo