Bug 33232 - Diagnose comma in "read()," and "write(),"
Summary: Diagnose comma in "read()," and "write(),"
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2007-08-29 15:49 UTC by Tobias Burnus
Modified: 2007-08-31 16:22 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2007-08-29 15:49:43 UTC
The following is a common vendor extension but to my knowledge not allowed up to Fortran 2003 (and probably also Fortran 2008):

write(*,*), 'Hello'
read(*,*), a
end

gfortran -pedantic -std=f95 -Wall accepts simply accepts it.

ifort -stand f03  reports correctly:

fortcom: Warning: a.f90, line 1: Use of comma to separate io-access spec and io_list is non_standard.
write(*,*), 'Hello'
----------^
fortcom: Warning: a.f90, line 2: Use of comma to separate io-access spec and io_list is non_standard.
read(*,*), a
---------^
Comment 1 patchapp@dberlin.org 2007-08-31 14:05:23 UTC
Subject: Bug number PR 33232

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-08/msg02276.html
Comment 2 Tobias Burnus 2007-08-31 16:02:11 UTC
Subject: Bug 33232

Author: burnus
Date: Fri Aug 31 16:01:57 2007
New Revision: 127997

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127997
Log:
2007-08-31  Tobias Burnus  <burnus@net-b.de>

	PR fortran/33232
	* io.c (match_io): Also diagnose extra comma for READ.

2007-08-31  Tobias Burnus  <burnus@net-b.de>

        PR fortran/33232
	* gfortran.dg/eor_handling_2.f90: Add dg-warnings.
	* gfortran.dg/read_1.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/read_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/io.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/eor_handling_2.f90

Comment 3 Tobias Burnus 2007-08-31 16:22:09 UTC
FIXED for the trunk.
Contrary what I claimed in comment 0, only READ was affected - WRITE was already properly diagnosed.