This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/29912] Gfortran: string array functions behaving incorrectly...
- From: "pmason at ricardo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Nov 2006 12:38:42 -0000
- Subject: [Bug fortran/29912] Gfortran: string array functions behaving incorrectly...
- References: <bug-29912-13399@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from pmason at ricardo dot com 2006-11-21 12:38 -------
I'm not 100% certain, but I think it is valid code.
I think the "Fortran Standard" states that when assigning
string(s) of different lengths that if the lhs string(s) are shorter
than the rhs then the strings are truncated accordingly.
The statements in the example code:
ctemp = temper
ctemp = jetter(1,2)
are actually equivalent (from a fortran90 point of view) aren't they?.
NOTE1: changing the ctemp declaration to be bigger (e.g. len=514) prevents
memory/corruption but assignment still goes wrong.
NOTE2: All other f90 compilers I have tried seems to handle this "correctly."
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29912