Hi,

here's an annoying one.  Default initializing a
character array in a derived type leads to zero
padded strings instead of space-padded ones.
E.g.

  ! This works correctly:
  character(len=16) ::    tdefi(2) = (/'0z1jan0000','1hr       '/)
  !                                     1234567890

  ! Broken in derived type:
  type t_ctl
     character(len=16) :: tdefi(2) = (/'0z1jan0000','1hr       '/)
     !                                  1234567890
  end type t_ctl


See the attached program for details.


-- 
           Summary: Character array initialization in derived type: bad zero
                    padding
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anlauf at gmx dot de
  GCC host triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31487

Reply via email to