This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34795] inquire statement , direct= specifier incorrectly returns YES
- From: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jan 2008 05:32:00 -0000
- Subject: [Bug fortran/34795] inquire statement , direct= specifier incorrectly returns YES
- References: <bug-34795-15636@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from jvdelisle at gcc dot gnu dot org 2008-01-16 05:32 -------
I am not making a decision here yet. I will keep this PR open until I fix
another minor issue I have found.
I would like to comment that to do what you want to do here without any
ambiguity your code should be using INQUIRE(unit=19, opened=opn, access=acc)
and test the two conditions to determine what to do:
if (opn .and. acc="DIRECT
... do your direct stuff
end if
This is truly the most portable way to do it. I will also add that just taking
the F2003 standard at face value, gfortran has this right, IMHO. The standard
does not assume that a unit is a particular kind of device or I/O unit. There
are device types that just simply can not be access as DIRECT.
Respectfully, I think this is one of the most commonly misunderstood Fortran
features. Its understandably frustrating. I will return to this in a few
days. I have two other bugs in front. (BTW, I already have a trivial patch
that will change gfortran behavior, complexity of the fix is not the issue)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34795