This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran] PR16404 fix Number 4
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: GCC Fortran mailing list <fortran at gcc dot gnu dot org>,patch <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 11 Jul 2004 15:18:53 +0200
- Subject: [gfortran] PR16404 fix Number 4
This makes us issue a warning/error if a comma appears before the output
item list of a WRITE standard.
Built and tested. I also verified that the error is issued.
- Tobi
2004-07-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/16404
* io.c (match_io): Flag 'WRITE(...), ...' as extension.
Index: io.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/io.c,v
retrieving revision 1.11
diff -u -p -r1.11 io.c
--- io.c 29 Jun 2004 18:55:11 -0000 1.11
+++ io.c 11 Jul 2004 12:58:44 -0000
@@ -2146,8 +2146,12 @@ loop:
get_io_list:
/* Optional leading comma (non-standard). */
- if (!comma_flag)
- gfc_match_char (',');
+ if (!comma_flag
+ && gfc_match_char (',') == MATCH_YES
+ && k == M_WRITE
+ && gfc_notify_std (GFC_STD_GNU, "Comma before output item list "
+ "at %C is an extension") == FAILURE)
+ return MATCH_ERROR;
io_code = NULL;
if (gfc_match_eos () != MATCH_YES)