Commit 5e18375c by Tobias Burnus Committed by Tobias Burnus

re PR fortran/33232 (Diagnose comma in "read()," and "write(),")

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.

From-SVN: r127997
parent 75b22640
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 Joseph Myers <joseph@codesourcery.com> 2007-08-31 Joseph Myers <joseph@codesourcery.com>
* intrinsic.texi (LGAMMA): Remove empty @cindex line. * intrinsic.texi (LGAMMA): Remove empty @cindex line.
......
...@@ -2975,9 +2975,8 @@ get_io_list: ...@@ -2975,9 +2975,8 @@ get_io_list:
/* Optional leading comma (non-standard). */ /* Optional leading comma (non-standard). */
if (!comma_flag if (!comma_flag
&& gfc_match_char (',') == MATCH_YES && gfc_match_char (',') == MATCH_YES
&& k == M_WRITE && gfc_notify_std (GFC_STD_GNU, "Extension: Comma before i/o "
&& gfc_notify_std (GFC_STD_GNU, "Extension: Comma before output " "item list at %C") == FAILURE)
"item list at %C is an extension") == FAILURE)
return MATCH_ERROR; return MATCH_ERROR;
io_code = NULL; io_code = NULL;
......
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.
2007-08-31 Paolo Carlini <pcarlini@suse.de> 2007-08-31 Paolo Carlini <pcarlini@suse.de>
PR c++/33210 PR c++/33210
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
program main program main
character(len=1) c1(10),c2(10) character(len=1) c1(10),c2(10)
open(77,status='scratch') open(77,status='scratch')
write(77,'(A)') 'Line 1','Line 2','Line 3' write(77,'(A)'), 'Line 1','Line 2','Line 3' ! { dg-warning "Comma before i/o item list" }
rewind(77) rewind(77)
read(77,'(10A1)'), c1 read(77,'(10A1)'), c1 ! { dg-warning "Comma before i/o item list" }
read(77,'(10A1)'), c2 read(77,'(10A1)'), c2 ! { dg-warning "Comma before i/o item list" }
if (c1(1) /= 'L' .or. c2(1) /= 'L') call abort if (c1(1) /= 'L' .or. c2(1) /= 'L') call abort
close(77) close(77)
end program main end program main
! { dg-do compile }
!
! Cf. PR fortran/33232
program test
implicit none
integer :: a
READ *, a
READ '(i3)', a
end program test
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment