From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28021 invoked by alias); 29 Jun 2013 14:44:14 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 28012 invoked by uid 89); 29 Jun 2013 14:44:13 -0000 X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from mx01.qsc.de (HELO mx01.qsc.de) (213.148.129.14) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 29 Jun 2013 14:44:12 +0000 Received: from archimedes.net-b.de (port-92-206-14-23.dynamic.qsc.de [92.206.14.23]) by mx01.qsc.de (Postfix) with ESMTP id F31993C6C3; Sat, 29 Jun 2013 16:44:08 +0200 (CEST) Message-ID: <51CEF2B8.2000106@net-b.de> Date: Sun, 30 Jun 2013 06:23:00 -0000 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: Donald Sheriff CC: gcc-help@gcc.gnu.org Subject: Re: converting from microsoft fortran References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-06/txt/msg00233.txt.bz2 Donald Sheriff wrote: > 9KARK*23(4)/'BS6399-BASIC CODE-SYM ', > 1 > Error: Syntax error in data declaration at (1) > > (The error is at the left bracket if the spacing doesn't show) > The full program is here: > https://dl.dropboxusercontent.com/u/52473465/wnsndt2.for > > Can anyone help me with the gcc syntax? The code declares a character array as CHARACTER KARK*23(4) which is not permitted. You could replace it by CHARACTER*23 KARK(4) (The latter syntax is according to the Fortran standard (Fortran 77, 90, 95, 2003, 2008) and should be accepted by all Fortran compilers.) That modification seems to be sufficient to make the code compile with gfortran. * * * The code uses also other vendor extensions (which are supported by gfortran). To make the code conforming with the ISO/IEC Fortran standard, some more modificiations are required; e.g. the initialization with /.../ is only permitted with DATA and not in with the variable declaration, i.e. CHARACTER*1 CLASS(3) /'A','B','C'/ should be CHARACTER*1 CLASS(3) DATA CLASS/'A','B','C'/ or (since Fortran 90 and later) CHARACTER*1 :: CLASS(3) = (/ 'A', 'B', 'C' /) But if you just want to compile it with gfortran, you don't need those as gfortran supports this initialization as vendor extension. Tobias --- wnsndt2.for.orig 2013-06-29 16:31:07.258765843 +0200 +++ wnsndt2.for 2013-06-29 16:33:30.034489250 +0200 @@ -101,3 +101,3 @@ +S3FACT(8),TS3FACT(9),S2MULT(4) -c CHARACTER CLASS*1(3) /'A','B','C'/ + CHARACTER*1 CLASS(3) /'A','B','C'/ DATA @@ -194,5 +194,5 @@ +SBKM(4),RMUL(4),SBB(4),RMD(4),CHKS(4),RMU1(4),DALT(4) - CHARACTER + CHARACTER*23 C 9LCA*4(2)/' ','(CS)'/, - 9KARK*23(4)/'BS6399-BASIC CODE-SYM ', + 9KARK(4)/'BS6399-BASIC CODE-SYM ', 9 'BS6399-BASIC CODE-ASYM',