This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, fortran] PR21432 - allow non-standard PRINT namelist


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;
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]