This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

[PATCH, libgfortran] Fix for PR25109


The attached patch fixes this PR. We were setting the default BLANK=behavior to UNSPECIFIED when it should have been "NULL"

Regression tested and NIST tested:

Could be considered obvious. I will wait to commit until tomorrow. I don't know how to do a test case for reading stdin. I did test with the examples in the pr.

2205-11-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>

	PR libgfortran/25109
	* io/unit.c (init_units): Set default flag to BLANK_NULL per
	requirement of F95 standard.  Set PAD_YES for stdin.
	(get_unit): Set PAD_YES for internal units.

Regards,

Jerry
Index: io/unit.c
===================================================================
--- io/unit.c	(revision 107558)
+++ io/unit.c	(working copy)
@@ -393,6 +393,7 @@ get_unit (st_parameter_dt *dtp, int do_c
       internal_unit.flags.action = ACTION_READWRITE;
       internal_unit.flags.form = FORM_FORMATTED;
       internal_unit.flags.delim = DELIM_NONE;
+      internal_unit.flags.pad = PAD_YES;
 
       return &internal_unit;
     }
@@ -453,7 +454,8 @@ init_units (void)
       u->flags.access = ACCESS_SEQUENTIAL;
       u->flags.form = FORM_FORMATTED;
       u->flags.status = STATUS_OLD;
-      u->flags.blank = BLANK_UNSPECIFIED;
+      u->flags.blank = BLANK_NULL;
+      u->flags.pad = PAD_YES
       u->flags.position = POSITION_ASIS;
 
       u->recl = options.default_recl;
@@ -472,7 +474,7 @@ init_units (void)
       u->flags.access = ACCESS_SEQUENTIAL;
       u->flags.form = FORM_FORMATTED;
       u->flags.status = STATUS_OLD;
-      u->flags.blank = BLANK_UNSPECIFIED;
+      u->flags.blank = BLANK_NULL;
       u->flags.position = POSITION_ASIS;
 
       u->recl = options.default_recl;
@@ -491,7 +493,7 @@ init_units (void)
       u->flags.access = ACCESS_SEQUENTIAL;
       u->flags.form = FORM_FORMATTED;
       u->flags.status = STATUS_OLD;
-      u->flags.blank = BLANK_UNSPECIFIED;
+      u->flags.blank = BLANK_NULL;
       u->flags.position = POSITION_ASIS;
 
       u->recl = options.default_recl;

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