This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33254] Diagnose different string lengths in array constructors at run time
- From: "Tobias dot Schlueter at physik dot uni-muenchen dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Oct 2007 14:04:41 -0000
- Subject: [Bug fortran/33254] Diagnose different string lengths in array constructors at run time
- References: <bug-33254-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from Tobias dot Schlueter at physik dot uni-muenchen dot de 2007-10-11 14:04 -------
Subject: Re: Diagnose different string lengths in array
constructors at run time
dominiq at lps dot ens dot fr wrote:
> ------- Comment #7 from dominiq at lps dot ens dot fr 2007-10-11 12:34 -------
>> This is weird, and can't really be (well, in a hypothetical world where
>> only the bounds check goes wrong), as the whole array has only a single
>> string length, so I would expect it to either print two length one
>> strings or two length two strings, not one lenghth one string and one
>> length two string.
>
> I am not sure to understand the above. Each element of z is a string of length
> 2,
> y(1:len(trim(y))) is also of length 2, while x(1:len(trim(x))) is of length
> one,
> so the constructor should give an error.
Yes, I agree with the latter. What I menat is the following: after the
data has been added to the array, the compiler should use the string
length of the array, so if you do
CHARACTER*10 z
z = (/ something /)
print *, z
all printed strings should be length 10, no the contents of the constructor.
>> Are these with or without Paul's patch?
>
> with otherwise I got an ICE.
ok, thanks.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33254