This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47348] wrong string length with array constructor
- From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Jan 2011 19:14:07 +0000
- Subject: [Bug fortran/47348] wrong string length with array constructor
- Auto-submitted: auto-generated
- References: <bug-47348-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47348
Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|substring with len_trim in |wrong string length with
|array constructor |array constructor
--- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-01-19 19:14:04 UTC ---
Reduced test case:
program main
implicit none
character(len=*), parameter :: fmt='(2(A,"|"))'
integer :: i
character(len=4) :: q
q = 'yy'
i = 2
print fmt, (/ trim(q), 'ae' /)//'c'
print fmt, (/ q(1:i), 'ae' /)//'c'
end program main
This prints
yyc|aec|
yy c|ae c|
so the string length of the array constructor is wrong.