From patchwork Sun Mar 22 21:05:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry DeLisle X-Patchwork-Id: 453228 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0C50F14011D for ; Mon, 23 Mar 2015 08:05:36 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=EAHZNDmy; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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:references :in-reply-to:content-type; q=dns; s=default; b=ZPnMd8IQs4a8ETSdC Usc+s3d2ZWgjdK7hsBaPqP6h+iiAA0AjmIS8V45x9OSJcjivPYkVq+ekACmYlAoQ gimawbHuGF+0DGREu3dn/VSFr3v5lPfX+cyWE9HSsvpbYoto9k0mxe1M+/eJi9Wr Vyvt2jngcPPj6ycGWXYVqQM4g0= 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:references :in-reply-to:content-type; s=default; bh=JhWKcZK6+ffC2wxefESr4mP fPM4=; b=EAHZNDmyEyxzxH2X6v9G5kF1ogf7kP2vMW2W2qRESVIGvt6IDFtSTpX aH8T4lCWMJyeeBLKtkWECjSSjJBXi/2e20fZy9xLECS28pSk9862eUi+jR6aqeZw DjVVovyV/XssyTEFJw0VhgWRGrcq0nlAHHlr3Lljcv8GQrWCgSsQ= Received: (qmail 114624 invoked by alias); 22 Mar 2015 21:05:27 -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 114612 invoked by uid 89); 22 Mar 2015 21:05:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sun, 22 Mar 2015 21:05:24 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YZn3f-0003Vp-Qj for gcc-patches@gcc.gnu.org; Sun, 22 Mar 2015 17:05:23 -0400 Received: from mta31.charter.net ([216.33.127.82]:45415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZn3f-0003Vb-MB; Sun, 22 Mar 2015 17:05:19 -0400 Received: from imp09 ([10.20.200.9]) by mta31.charter.net (InterMail vM.8.01.05.02 201-2260-151-103-20110920) with ESMTP id <20150322210507.BQCN10321.mta31.charter.net@imp09>; Sun, 22 Mar 2015 17:05:07 -0400 Received: from mtaout002.msg.strl.va.charter.net ([68.114.190.27]) by imp09 with smtp.charter.net id 6l571q0040buw5Q05l57Ur; Sun, 22 Mar 2015 17:05:07 -0400 Received: from impout004 ([68.114.189.19]) by mtaout002.msg.strl.va.charter.net (InterMail vM.9.00.015.01 201-2473-143-101) with ESMTP id <20150322210507.PAMX20170.mtaout002.msg.strl.va.charter.net@impout004>; Sun, 22 Mar 2015 16:05:07 -0500 Received: from pavi.localdomain ([70.211.5.250]) by impout004 with charter.net id 6l561q00A5PfqVS01l56Qg; Sun, 22 Mar 2015 16:05:07 -0500 X-Authority-Analysis: v=2.1 cv=X/ncKQje c=1 sm=1 tr=0 a=ieLAS0gp2pFypyHxrI4i0w==:117 a=ieLAS0gp2pFypyHxrI4i0w==:17 a=hOpmn2quAAAA:8 a=XuYyiiJQKFMA:10 a=r77TgQKjGQsHNAKrUKIA:9 a=9iDbn-4jx3cA:10 a=cKsnjEOsciEA:10 a=gZbpxnkM3yUA:10 a=1cvrqpgQkt3WRKEyAOgA:9 a=QEXdDO2ut3YA:10 a=peBj029K1w5YljJ8f8kA:9 X-Auth-id: anZkZWxpc2xlQGNoYXJ0ZXIubmV0 Message-ID: <550F2E81.8040600@charter.net> Date: Sun, 22 Mar 2015 14:05:05 -0700 From: Jerry DeLisle User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Janne Blomqvist CC: gfortran , gcc patches Subject: Re: [Patch, Fortran, 4.8/4.9/5 Regression] PR59513 READ or WRITE not allowed after EOF References: <550C9E2A.2060501@charter.net> In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 216.33.127.82 On 03/22/2015 08:47 AM, Janne Blomqvist wrote: > On Sat, Mar 21, 2015 at 12:24 AM, Jerry DeLisle wrote: >> The attached patch allows the attempt to READ or WRITE after an EOF for >> legacy code. The runtime error is suppressed for -std=legacy and -std=gnu. >> For standard conformance the error is retained as is now. > > Since it's a standard violation rather than a GNU extension, I'd > prefer if it were enabled only with -std=legacy. > > Ok with this change. > > The attached patch adds documentation under 'extensions' in gfortran.texi. Tested with make html. I will commit soon with a ChangeLog entry Regards, Jerry Index: gfortran.texi =================================================================== --- gfortran.texi (revision 221544) +++ gfortran.texi (working copy) @@ -1404,6 +1404,7 @@ without warning. * OpenMP:: * OpenACC:: * Argument list functions:: +* Read/Write after EOF marker:: @end menu @node Old-style kind specifications @@ -2049,7 +2050,19 @@ For details refer to the g77 manual Also, @code{c_by_val.f} and its partner @code{c_by_val.c} of the GNU Fortran testsuite are worth a look. +@node Read/Write after EOF marker +@subsection Read/Write after EOF marker +@cindex @code{EOF} +@cindex @code{BACKSPACE} +@cindex @code{REWIND} +Some legacy codes rely on allowing @code{READ} or @code{WRITE} after the +EOF file marker in order to find the end of a file. GNU Fortran normally +rejects these codes with a run-time error message and suggests the user +consider @code{BACKSPACE} or @code{REWIND} to properly position +the file before the EOF marker. As an extension, the run-time error may +be disabled using -std=legacy. + @node Extensions not implemented in GNU Fortran @section Extensions not implemented in GNU Fortran @cindex extensions, not implemented