From patchwork Sun May 5 00:13:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry DeLisle X-Patchwork-Id: 241494 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 6A9D42C00C0 for ; Sun, 5 May 2013 10:14:12 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=PH3jHtp1b5T6wusfB4yaLhOsMlN5LPnVMqa2kg5Mx/Q 3AtDWGnK0/+xkGG4sfJPquijnz4G00jyfz6TJmHZzN/09+iHLKWKAO9g6/r0U8P5 f1eFDYhJGkPHHlvvm4yJMbbYTFXF1WX7fJbhujiBupKW6R9ISWOLh5da/gxr2CuU = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=snri5miUpaDGdPak02iwrASBK18=; b=oeVLXqfdJOz56Y/uz ebE8WcaVmEsMLki11fFevS9YD9L2QwJI+NuqrAsQnwa5tgMefsqG9Ei6g/f9I4m3 Nu6I7BWZFmBP+HAvy6ZSmEOIH4s7J7BneGimGfzA4aLMOAdagt+PPTupLb8s3IQ6 9WeFu1Zt5e9bQBD+rX1Z8bBPiE= Received: (qmail 24125 invoked by alias); 5 May 2013 00:14:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 24088 invoked by uid 89); 5 May 2013 00:13:56 -0000 X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from mta41.charter.net (HELO mta41.charter.net) (216.33.127.83) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sun, 05 May 2013 00:13:55 +0000 Received: from imp11 ([10.20.200.11]) by mta41.charter.net (InterMail vM.8.01.05.02 201-2260-151-103-20110920) with ESMTP id <20130505001353.VVQR10143.mta41.charter.net@imp11>; Sat, 4 May 2013 20:13:53 -0400 Received: from quava.localdomain ([72.194.70.222]) by imp11 with smtp.charter.net id Y0Dr1l00V4nkj6o050DsHi; Sat, 04 May 2013 20:13:52 -0400 X-Authority-Analysis: v=2.0 cv=dIr+A5lb c=1 sm=1 a=L8sds5GVmE6e+zP2dgJA1w==:17 a=VW8mOq7NZXgA:10 a=gU7EvB3CJAEA:10 a=yUnIBFQkZM0A:10 a=hOpmn2quAAAA:8 a=MXwmy3FulzAA:10 a=Xdyk9Bymf5iqb95yQfcA:9 a=wPNLvfGTeEIA:10 a=SiAS5HofrADlJBqtscUA:9 a=NKMpYGfs96W656sX:21 a=F-BBmTVe_4n9-e9M:21 a=z-zS-5qfjDvU6O2BdcQA:9 a=L8sds5GVmE6e+zP2dgJA1w==:117 X-Auth-id: anZkZWxpc2xlQGNoYXJ0ZXIubmV0 Message-ID: <5185A43F.3000900@charter.net> Date: Sat, 04 May 2013 17:13:51 -0700 From: Jerry DeLisle User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 MIME-Version: 1.0 To: gfortran CC: gcc patches Subject: [patch, libgfortran] PR56743 Namelist bug with comment and no blank X-Virus-Found: No The attached patch resolves this PR by treating '!', the Fortran comment mark, as a valid separator between values. Thus, when encountered while reading a value, the read is ended normally with whatever value was encountered. This is an extension beyond the Standards which require a separator before a comment mark. I must emphasize that extensions like this are no guarantee of portability across compilers. Users should use well formed namelists always. Regression tested on x86-64. Test case attached. OK for trunk? Regards, Jerry Index: list_read.c =================================================================== --- list_read.c (revision 198600) +++ list_read.c (working copy) @@ -840,6 +840,7 @@ read_integer (st_parameter_dt *dtp, int length) CASE_SEPARATORS: /* Not a repeat count. */ case EOF: + case '!': goto done; default: @@ -890,6 +891,7 @@ read_integer (st_parameter_dt *dtp, int length) CASE_SEPARATORS: case EOF: + case '!': goto done; default: @@ -1489,6 +1491,7 @@ read_real (st_parameter_dt *dtp, void * dest, int CASE_SEPARATORS: case EOF: + case '!': if (c != '\n' && c != ',' && c != '\r' && c != ';') unget_char (dtp, c); goto done; @@ -1558,6 +1561,7 @@ read_real (st_parameter_dt *dtp, void * dest, int CASE_SEPARATORS: case EOF: + case '!': goto done; case '.': @@ -1618,6 +1622,7 @@ read_real (st_parameter_dt *dtp, void * dest, int CASE_SEPARATORS: case EOF: + case '!': goto done; default: