This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/22273] New: problem to declare a character variable link to an intent(out) object
- From: "gruel at astro dot ufl dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jul 2005 20:43:09 -0000
- Subject: [Bug fortran/22273] New: problem to declare a character variable link to an intent(out) object
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I think that this error message is a bug in gfortran. I don't see anythink
forbidden in fortran 95 to explain it.
gfortran -c mod_lecfich.f90
In file mod_lecfich.f90:32
character(len=len(ligne)) :: comment
1
Error: Dummy argument 'ligne' at (1) cannot be INTENT(OUT)
make: *** [mod_lecfich.o] Error 1
the subroutine incriminate is:
subroutine lecligne (nomfich,ligne)
use mod_common
character(len=*), intent(in) :: nomfich
character(len=*), dimension(:),intent(out) :: ligne
integer(kind=i4b) :: err,taille
character(len=len(ligne)) :: comment
open (unit=1,file=nomfich,form="formatted",status="old",action="read",iostat
=err,position="rewind")
if (err /= 0) then
print*, "error to open the file ",trim(nomfich)
stop
end if
taille = 1
do
read (unit=1,fmt="(a)",iostat=err) ligne(taille)
if (err < 0) then
exit
end if
comment = trim(adjustl(ligne(taille)))
if (comment(1:1) == "#") cycle
taille = taille + 1
print*, comment
end do
close (unit=1)
return
end subroutine lecligne
--
Summary: problem to declare a character variable link to an
intent(out) object
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gruel at astro dot ufl dot edu
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22273