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: "pault at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Nov 2006 12:59:36 -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 #5 from pault at gcc dot gnu dot org 2006-11-21 12:59 -------
(In reply to comment #4)
> 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."
>
I will check the standard - it might well be that you are right; what I said
applies to actual arguments, doen't it?
Paul
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29912