subroutine test(cha) implicit none character(len=10) :: cha(:) namelist /z/ cha end subroutine test
See also: gfortran.dg/namelist_14.f90 This is invalid: "5.4 NAMELIST statement" "C574 (R553) A namelist-group-object shall not be an assumed-size array." Other compilers reject this: ifort: A NAMELIST group object must not be an array with nonconstant bounds. [CHA] g95: Variable 'cha' at (1) must have an explicit shape to be in a NAMELIST NAG f95: Namelist-group-object CHA is an array dummy with non-constant bounds -- Summary: Wrongly accepts namelists with assumed-sized arrays Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31818