This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/36112] Bounds-checking on character length not working for array-constructors
- From: "d at domob dot eu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 May 2008 18:26:22 -0000
- Subject: [Bug fortran/36112] Bounds-checking on character length not working for array-constructors
- References: <bug-36112-15965@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from d at domob dot eu 2008-05-03 18:26 -------
Now I've been analysing a test looking like:
test("abc", "foobar", "hello")
contains
subroutine test(r, s)
character(len=*) :: r, s
character(len=128) :: arr(2)
arr = (/ r, s /)
end subroutine test
end
Which does not trigger the bounds-error, too. It seems like the hidden
parameter _s (i.e. s's length) is used as the length of r for everything inside
the array constructor, that is for the bounds-checking runtime check (why it
does not trigger the error) and also for the memcpy call and related stuff.
So far I don't know why this is the case, but hopefully I'll find out later and
fix it... Of course I'd appreciate any hints ;)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36112