From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1709 invoked by alias); 2 Oct 2007 23:31:13 -0000 Received: (qmail 1691 invoked by uid 22791); 2 Oct 2007 23:31:10 -0000 X-Spam-Check-By: sourceware.org Received: from vms048pub.verizon.net (HELO vms048pub.verizon.net) (206.46.252.48) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 02 Oct 2007 23:31:08 +0000 Received: from quasar.localdomain ([71.115.219.45]) by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JPB00LG95BJOUB0@vms048.mailsrvcs.net>; Tue, 02 Oct 2007 18:30:56 -0500 (CDT) Date: Tue, 02 Oct 2007 23:31:00 -0000 From: Jerry DeLisle Subject: Re: [patch, libfortran] PR33253 namelist: reading back a string with apostrophe In-reply-to: <47010739.9060204@verizon.net> To: FX Coudert Cc: Fortran List , gcc-patches Message-id: <4702D492.9090504@verizon.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit References: <4700818E.5090200@verizon.net> <47010739.9060204@verizon.net> User-Agent: Thunderbird 2.0.0.5 (X11/20070727) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-10/txt/msg00152.txt.bz2 Jerry DeLisle wrote: > FX Coudert wrote: >>> In addition, this patch adjusts the conditions that allow extended >>> reads of namelists. This now requires -std=legacy. The reason is >>> that all these cases with non standard namelists such as extra data >>> or no delimiters end up conflicting. The mechanism for handling >>> these is present, its a matter of choice when to allow what. >> >> Short of a proper review, which I might do later this week, I want to >> note that as this requires users to turn change compiler options for >> their (broken) code, this should probably be noted in the release notes. >> >> FX >> > I agree. Another thing that would be helpful is to see how other > compilers handle the test cases given. I only have ifort. > > ifort fails on namelist_15.f90 but passes on namelist_24.f90 with no > compiler options. > > Any comment on the behavior we want would be appreciated. > > Jerry > Fx, After some additional study on this one, we are able to fix everything without changing the require compiler options. The following patch does it. Addition of one more test for the bail out logic. Index: list_read.c =================================================================== --- list_read.c (revision 128954) +++ list_read.c (working copy) @@ -893,7 +893,10 @@ read_character (st_parameter_dt *dtp, in goto get_string; default: - if (dtp->u.p.namelist_mode) + if (dtp->u.p.namelist_mode + && (dtp->u.p.current_unit->flags.delim == DELIM_APOSTROPHE + || dtp->u.p.current_unit->flags.delim == DELIM_QUOTE + || quote == ' ')) { unget_char (dtp,c); return; OK for trunk? Test cases remain the same except no -std=legacy for namelist_24.f90 Jerry