http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50070
--- Comment #4 from janus at gcc dot gnu.org 2011-08-14 12:02:57 UTC --- (In reply to comment #3) > The relevant quote from the F08 std is probably: > > "C417 (R422) A type-param-value in a char-length shall be a colon, asterisk, > or > specification-expr." > > together with chapter 7.1.11 ("Specification expression"). Based on chapter 7.1.11, I would say that g95's error message is wrong: z does not have to have constant length. "A specification-expr shall be a constant expression unless it is in an interface body (12.4.3.2), the specification part of a subprogram or BLOCK construct, a derived type definition, or the declaration-type-spec of a FUNCTION statement (12.6.2.2)." Since z is in the specification part of a subprogram, there is no need for to have constant length.