http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49324
--- Comment #2 from Joshua Cogliati <jjcogliati-r1 at yahoo dot com> 2011-06-08 16:30:16 UTC --- (In reply to comment #1) > Not an analysis, just some observations ... > > I get different results with different compilers: > gfortran 4.7: > array2d second 2 3 '' '@' '`' '`A�▒' '@' 'A�' > [Neither NAG with -C=all -C=undefined, nor ifort -check all, nor gfortran > -fcheck=all show an error.] > > > I tried also the other ISO Varying String implementations at > ftp://ftp.nag.co.uk/sc22wg5/ISO_VARYING_STRING/Sample_Module/ , but I fail to > get a consistent result with those. > > gfortran, g95, NAG, pgf90 and pathf95 with iso_vst.f90 > and with g95, pgf90 and pathf95 for iso_vsta.f90: > array2d second 2 3 '1' '2' '3' 'four' '5' 'six' > gfortran with iso_vsta.f90: > array2d second 2 3 '' '�' '�' '�jb' '�' 'b' Hm. http://www.fortran.com/iso_varying_string.f95 and iso_vsta.f90 use: TYPE VARYING_STRING PRIVATE CHARACTER,DIMENSION(:),ALLOCATABLE :: chars ENDTYPE VARYING_STRING iso_vst.f90 uses: TYPE VARYING_STRING PRIVATE CHARACTER,DIMENSION(:),POINTER :: chars => NULL() ENDTYPE VARYING_STRING so for gfortran at least, it seems to happen when there is a allocatable character array, but not a pointer.