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: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Mar 2008 16:54:32 -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 #11 from fxcoudert at gcc dot gnu dot org 2008-03-25 16:54 -------
(In reply to comment #10)
> Hm, what about adding a case to gfc_resolve_character_array_constructor
> handling arrays *with* given length by padding all elements that are shorter?
> Would this work?
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
(I haven't yet found a compiler that does compile this and run it fine.)
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|fxcoudert at gcc dot gnu dot|unassigned at gcc dot gnu
|org |dot org
Status|ASSIGNED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27997