From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29011 invoked by alias); 1 Apr 2008 10:18:12 -0000 Received: (qmail 28832 invoked by uid 48); 1 Apr 2008 10:17:28 -0000 Date: Tue, 01 Apr 2008 10:18:00 -0000 Message-ID: <20080401101728.28831.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: "burnus 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-04/txt/msg00032.txt.bz2 ------- Comment #16 from burnus at gcc dot gnu dot org 2008-04-01 10:17 ------- (In reply to comment #15) > However, the following program without typespec in the array constructor also > fails (according to my judging what it should do) Different compilers give different output for this one, but this is no problem as the program is invalid. "gfortran -fbounds-check" shows the problem: Fortran runtime error: Different CHARACTER lengths (4/5) in array constructor That is the reason why (/ typespec :: element-list /) is needed. How long should be each element for (/ "a", "bb", "ccc" /) ? One, two, three or ... characters? One could argue that is should match the longest, but this is an arbitrary choice and makes the run-time array construction slower. Actually, with the Intel compiler, 's, "test"' and '"test", s' produce different results ;-) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27997