------- 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