public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/43409]  New: I/O: INQUIRE for SIZE does not work.
@ 2010-03-17 17:31 burnus at gcc dot gnu dot org
  2010-03-17 17:35 ` [Bug fortran/43409] " burnus at gcc dot gnu dot org
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-03-17 17:31 UTC (permalink / raw)
  To: gcc-bugs

Found at
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/110fb27c70e1a193
Reported by: Philippe Bourdin

The following program always prints "-42" independent whether the file exists
or not. It at least should initialize the variable by "-1".

!-------------------
integer :: i
i = -42
inquire(file='test.dat', size=i)
print *, i
end
!-------------------


"9.9.1.29 SIZE= specifier in the INQUIRE statement"

"The scalar-int-variable in the SIZE= specifier is assigned the size of the
file in file storage units. If the file size cannot be determined, the variable
is assigned the value -1.

"For a file that may be connected for stream access, the file size is the
number of the highest-numbered file storage unit in the file. For a file that
may be connected for sequential or direct access, the file size may be
different from the number of storage units implied by the data in the records;
the exact relationship is processor-dependent."


-- 
           Summary: I/O: INQUIRE for SIZE does not work.
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2010-03-31  2:10 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-17 17:31 [Bug fortran/43409] New: I/O: INQUIRE for SIZE does not work burnus at gcc dot gnu dot org
2010-03-17 17:35 ` [Bug fortran/43409] " burnus at gcc dot gnu dot org
2010-03-17 17:43 ` burnus at gcc dot gnu dot org
2010-03-18  2:14 ` jvdelisle at gcc dot gnu dot org
2010-03-19  3:24 ` jvdelisle at gcc dot gnu dot org
2010-03-19 17:40 ` burnus at gcc dot gnu dot org
2010-03-19 20:26 ` jvdelisle at gcc dot gnu dot org
2010-03-20 14:39 ` jvdelisle at gcc dot gnu dot org
2010-03-20 14:42 ` jvdelisle at gcc dot gnu dot org
2010-03-21  8:58 ` dominiq at lps dot ens dot fr
2010-03-21 13:31 ` jvdelisle at gcc dot gnu dot org
2010-03-22  2:03 ` jvdelisle at gcc dot gnu dot org
2010-03-22  2:39 ` jvdelisle at gcc dot gnu dot org
2010-03-22  2:41 ` jvdelisle at gcc dot gnu dot org
2010-03-22  9:05 ` dominiq at lps dot ens dot fr
2010-03-22 12:29 ` dominiq at lps dot ens dot fr
2010-03-31  2:00 ` jvdelisle at gcc dot gnu dot org
2010-03-31  2:01 ` jvdelisle at gcc dot gnu dot org
2010-03-31  2:06 ` jvdelisle at gcc dot gnu dot org
2010-03-31  2:10 ` jvdelisle at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).