[Bug fortran/29912] Gfortran: string array functions behaving incorrectly...
pault at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Nov 21 12:59:00 GMT 2006
------- 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
More information about the Gcc-bugs
mailing list