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, gfortran] Fix for fortran PR/12701 (second try).


Paul Brook wrote:

On Friday 24 October 2003 8:14 pm, Toon Moene wrote:

The attached patch fixes fortran PR/12701 with no regressions.

I suspect you're forgetting to free the memory you allocate to hole the filename (not a major issue). Other than that it's ok.

This is the better patch I told you about. Bootstrapped [tree-ssa] C and f95; make -k check gfortran only - no regressions.


OK to apply ?

--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://gcc.gnu.org/fortran/ (under construction)
2003-10-28  Toon Moene  <toon@moene.indiv.nluug.nl>

	PR fortran/12701
	* open.c (new_unit): Open without a file name opens
	a file with name fort.<unit>.

*** open.c.orig	Fri Sep 19 21:46:40 2003
--- open.c	Tue Oct 28 18:57:44 2003
*************** new_unit (unit_flags * flags)
*** 252,257 ****
--- 252,258 ----
  {
    unit_t *u;
    stream *s;
+   char tmpname[5 /* fort. */ + 10 /* digits of unit number */ + 1 /* 0 */];
  
    /* Change unspecifieds to defaults */
  
*************** new_unit (unit_flags * flags)
*** 354,362 ****
        if (ioparm.file != NULL)
  	break;
  
!       generate_error (ERROR_MISSING_OPTION,
! 		      "FILE parameter required in OPEN statement");
!       return;
  
      default:
        internal_error ("new_unit(): Bad status");
--- 355,363 ----
        if (ioparm.file != NULL)
  	break;
  
!       ioparm.file = tmpname;
!       ioparm.file_len = sprintf(ioparm.file, "fort.%d", ioparm.unit);
!       break;
  
      default:
        internal_error ("new_unit(): Bad status");
*************** new_unit (unit_flags * flags)
*** 396,402 ****
    u->last_record = 0;
    u->current_record = 0;
  
!   /* If the file is direct access, calcuate the maximum record number
     * via a division now instead of letting the multiplication overflow
     * later. */
  
--- 397,403 ----
    u->last_record = 0;
    u->current_record = 0;
  
!   /* If the file is direct access, calculate the maximum record number
     * via a division now instead of letting the multiplication overflow
     * later. */
  

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