This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR21432 - allow non-standard PRINT namelist
- From: Paul Thomas <paulthomas2 at wanadoo dot fr>
- To: joe at confucius dot gnacademy dot org
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Wed, 03 Aug 2005 22:32:06 +0200
- Subject: Re: [Patch, fortran] PR21432 - allow non-standard PRINT namelist
- References: <42F1287C.4070001@wanadoo.fr>
Apologies, the ChangeLog entry cut and paste OK but the patch did not.
It looked OK as sent.
Please find the patch attached.
Paul T
Index: gcc/gcc/fortran/io.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/io.c,v
retrieving revision 1.28
diff -c -3 -p -r1.28 io.c
*** gcc/gcc/fortran/io.c 7 Jul 2005 07:54:42 -0000 1.28
--- gcc/gcc/fortran/io.c 3 Aug 2005 20:29:24 -0000
*************** match_io (io_kind k)
*** 2125,2130 ****
--- 2125,2150 ----
if (gfc_match_char ('(') == MATCH_NO)
{
+
+ /* Treat the non-standard case of PRINT namelist. */
+ if (k == M_PRINT && (gfc_match_name (name) == MATCH_YES)
+ && !gfc_find_symbol (name, NULL, 1, &sym)
+ && (sym->attr.flavor == FL_NAMELIST)
+ && (gfc_notify_std (GFC_STD_GNU, "Extension: PRINT namelist "
+ "at %C is an extension") == SUCCESS))
+ {
+ if (gfc_match_eos () == MATCH_NO)
+ {
+ gfc_error ("Namelist followed by I/O list at %C");
+ m = MATCH_ERROR;
+ goto cleanup;
+ }
+
+ dt->io_unit = default_unit (k);
+ dt->namelist = sym;
+ goto get_io_list;
+ }
+
if (k == M_WRITE)
goto syntax;