[Bug fortran/32646] INQUIRE (by UNIT) for (un)formatted always returns YES...

tobias dot burnus at physik dot fu-berlin dot de gcc-bugzilla@gcc.gnu.org
Fri Jul 6 13:50:00 GMT 2007



------- Comment #1 from tobias dot burnus at physik dot fu-berlin dot de  2007-07-06 13:50 -------
I think this is invalid.

The normative words are, from 9.6.1.11

"The scalar-default-char-variable in the FORMATTED= specifier is
assigned the value YES if FORMATTED is included in the set of allowed
forms for the file, NO is FORMATTED is not included in the set of
allowed forms for the file, and UNKNOWN if the processor is unable to
determine whether or not FORMATTED is included in the set of allowed
forms for the file." 

gfortran/g95:  yes, yes
openf95/ifort: no, yes
NAG f95: unknown, yes

I think NAG's answer is most correct: It formatted=Yes as it seemingly works
(the file is open) while one does not know whether it can be opened as
unformatted.

ifort/openf95 simply assume it cannot be whereas g95/gfortran assume that one
can do so.
If the file is empty the answer YES is correct. If the file is not empty,
reading a formatted file as unformatted will probably not work, but still it
may work.

I personally regard this part of the inquiry function as useless.

See also:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/30719cf69f699d34


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32646



More information about the Gcc-bugs mailing list