[Bug fortran/27997] Fortran 2003: Support type-spec for array constructor
d at domob dot eu
gcc-bugzilla@gcc.gnu.org
Tue Mar 25 17:11:00 GMT 2008
------- 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
More information about the Gcc-bugs
mailing list