[patch, libgfortran] PR105456 Child I/O does not propage iostat

Jerry D jvdelisle2@gmail.com
Thu Feb 22 19:11:25 GMT 2024


Hi all,

The attached fix adds a check for an error condition from a UDDTIO 
procedure in the case where there is no actual underlying error, but the 
user defines an error by setting the iostat variable manually before 
returning to the parent READ.

I did not address the case of a formatted WRITE or unformatted 
READ/WRITE until I get some feedback on the approach. If this approach 
is OK I would like to commit and then do a separate patch for the cases 
I just mentioned.

Feedback appreciated.  Regression tested on x86_64. OK for trunk?

Jerry

Author: Jerry DeLisle <jvdelisle@gcc.gnu.org>
Date:   Thu Feb 22 10:48:39 2024 -0800

     libgfortran: Propagate user defined iostat and iomsg.

             PR libfortran/105456

     libgfortran/ChangeLog:

             * io/list_read.c (list_formatted_read_scalar): Add checks
             for the case where a user defines their own error codes
             and error messages and generate the runtime error.

     gcc/testsuite/ChangeLog:

             * gfortran.dg/pr105456.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr105456.diff
Type: text/x-patch
Size: 3000 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20240222/a5df6a08/attachment.bin>


More information about the Fortran mailing list