From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28463 invoked by alias); 25 Mar 2008 16:55:14 -0000 Received: (qmail 28301 invoked by uid 48); 25 Mar 2008 16:54:32 -0000 Date: Tue, 25 Mar 2008 16:55:00 -0000 Message-ID: <20080325165432.28300.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/27997] Fortran 2003: Support type-spec for array constructor In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "fxcoudert at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg01990.txt.bz2 ------- 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