------- Comment #12 from d at domob dot eu 2008-03-25 17:10 ------- (In reply to comment #11) > Sounds like the right place. Care should be taken because lengths are not > required to be constants, like in the following: > > call foo(8, "short") > call foo(2, "lenghty") > contains > subroutine foo(n,s) > character(len=*) s > integer n > print *, [ character(len=n) :: 'test', s ] > end subroutine > end
Well, I'm not sure if the patch I've got in mind would handle this... I'm thinking of padding string literals shorter than the array's length at compile time when this length is constant. For non-constant lengths I suppose a runtime call would be needed to pad correctly? Is this important or should I first make constant lengths work? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27997