[Bug fortran/78854] [F03] DTIO namelist output not working on internal unit

janus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Dec 19 10:44:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78854

--- Comment #2 from janus at gcc dot gnu.org ---
I'm afraid I have too little knowledge of the I/O parts of libgfortran to fix,
but I can at least give some pointers to where things appear to go wrong ...

In the function "nml_write_obj" at line 2210 of write.c there is a block
starting with:


              if (obj->dtio_sub != NULL)
                {
                  int unit = dtp->u.p.current_unit->unit_number;


This whole block deals with calling DTIO procedures. Apparently the line above
that sets the unit is not enough to deal with internal units.

It seems that there is some code to deal with internal units e.g. in the
function "write_block" in transfer.c:

  if (is_internal_unit (dtp))
    ...


More information about the Gcc-bugs mailing list