This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/27997] Fortran 2003: Support type-spec for array constructor
- From: "d at domob dot eu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Mar 2008 17:10:29 -0000
- Subject: [Bug fortran/27997] Fortran 2003: Support type-spec for array constructor
- References: <bug-27997-1719@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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