[patch, libfortran] PR34795 inquire statement , direct= specifier incorrectly returns YES
Jerry DeLisle
jvdelisle@verizon.net
Sun Jan 20 09:58:00 GMT 2008
:ADDPATCH fortran:
This patch modifies gfortran behavior for inquire.
The specifiers DIRECT=, FORMATTED=, UNFORMATTED=, and SEQUENTIAL answer the
question whether a given file "may" be opened with the given specifier.
This implies that the given file or unit is not already opened.
The patch addresses the case where the files are already opened in which case we
can query the unit for the actual mode and return "YES","NO", "FORMATTED", or
"UNFORMATTED" accordingly.
SEQUENTIAL= was already handled this way.
Regression tested on X86-64-Linux. We have no existing test case that is
affected by this change. A new test case is provided.
This could ripple to users applications if they relied on previous behavior. I
will add that using these on opened files is not well addressed in the standard
if at all. Again, the implication is that the file is not already opened.
With the patch, gfortran is in agreement with Intel and Sun behavior.
OK for trunk?
Jerry
2008-01-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
* io/inquire.c (inquire_via_unit): If a unit is opened, return values
according to the open action for DIRECT=, FORMATTED=, and
UNFORMATTED=.
PS Is the patch tracker working any more?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inquire.diff
Type: text/x-patch
Size: 2017 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080120/49763be8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inquire_13.f90
Type: text/x-fortran
Size: 2281 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080120/49763be8/attachment-0001.bin>
More information about the Fortran
mailing list