--- Comment #3 from kloedej at knmi dot nl 2008-10-07 11:23 ---
Hi,
thanks for this discussion.
I do agree now that this code was invalid. I was thinking otherwise because no
compiletime or runtime error was issued by any of the compilers that I tried.
Checking this during compilation
--- 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)
--- Comment #2 from burnus at gcc dot gnu dot org 2008-10-06 19:53 ---
I think the true bug is that -fbounds-check misses the problem. NAG f95 prints
at run time:
CHARACTER actual arg LEN=50 shorter than dummy arg LEN=51
Program terminated by fatal error
--