This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/29912] Gfortran: string array functions behaving incorrectly...



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]