From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16101 invoked by alias); 12 Aug 2004 14:57:04 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 16063 invoked from network); 12 Aug 2004 14:57:00 -0000 Received: from unknown (HELO this.nrl.navy.mil) (132.250.158.124) by sourceware.org with SMTP; 12 Aug 2004 14:57:00 -0000 Received: from [132.250.158.142] ([132.250.158.142] verified) by this.nrl.navy.mil (Stalker SMTP Server 1.8b8) with ESMTP id S.0000297844; Thu, 12 Aug 2004 10:57:00 -0400 Mime-Version: 1.0 (Apple Message framework v618) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit Cc: michel.busquet@free.fr From: Michel Busquet (Forn_Natl) Subject: Fortran compilation bug Date: Thu, 12 Aug 2004 14:57:00 -0000 To: gcc-bugs@gcc.gnu.org X-SW-Source: 2004-08/txt/msg01121.txt.bz2 List-Id: The following source file produce an error at compilation time about alleged "undefined length" string Source file: ---------------- program a character ch*10 ch='abcd' call b(ch) stop end c subroutine b(ch) character ch*(*) integer i,l do i=1,len(ch) l=i if(ch(i:i).eq.' ') goto 1 enddo 1 call C(ch(1:l)//'ok') return end c subroutine C(ch) print *,ch return end Compilation command line and messages : ----------------------------------------------------------- $ g77 -o a.out a.f a.f: In subroutine `b': a.f:15: 1 call C(ch(1:l)//'ok') 1 2 Concatenation operator at (2) must operate on two scalar (not array) subexpressions, two function invocations returning character scalars, or a combination of both -- but the subexpression at (1) is of indeterminate length a.f: In subroutine `c': a.f:15: warning: 1 call C(ch(1:l)//'ok') 1 a.f:19: (continued): subroutine C(ch) 2 Argument #1 (named `ch') of `c' is one type at (2) but is some other type at (1) [info -f g77 M GLOBALS] Gcc Version: ----------------- gcc -v Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs Thread model: posix gcc version 3.3 20030304 (Apple Computer, Inc. build 1495) Platform and system: ---------------------------- iMac + Mac OS X 10.3