This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/37746] string copy fails, due to changed intent(in) parameter
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Oct 2008 14:47:30 -0000
- Subject: [Bug fortran/37746] string copy fails, due to changed intent(in) parameter
- References: <bug-37746-11277@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from kargl at gcc dot gnu dot org 2008-10-06 14:47 -------
Your code works if you fix the bug. You have two choices
program Test_StrCopy
character(len=50) :: a
character(len=51) :: b
a = "abcdefg"
call copy(a,b)
end program Test_StrCopy
or
subroutine copy(a,b)
character(len=*), intent(in) :: a
character(len=len(a)), intent(out) :: b
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37746