public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/38122]  New: "file already opened in another unit" error when opening /dev/null or /dev/tty twice
@ 2008-11-14 18:15 steven dot chapel at sbcglobal dot net
  2008-11-14 18:41 ` [Bug fortran/38122] " kargl at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: steven dot chapel at sbcglobal dot net @ 2008-11-14 18:15 UTC (permalink / raw)
  To: gcc-bugs

The following program runs without error when compiled with g77 3.4.6 on Redhat
Linux:

       character*72 fnint
       data fnint /'/dev/null'/
       i=index(fnint,' ')
       open(unit=29,file=fnint(1:i-1))
       open(unit=30,file=fnint(1:i-1))
       write(29,100)
       write(30,100)
 100   format('1Hello, world!')
       end

When compiled with gfortran 4.3.2 on Redhat Linux, the following error message
is printed when the program is run:

At line 5 of file bug.f (unit = 30, file = '')
Fortran runtime error: File already opened in another unit

The same error results when I use /dev/tty in place of /dev/null, although this
too works in g77 3.4.6.

This bug is causing me to have to modify a program called NONMEM VI to get it
to run properly.


-- 
           Summary: "file already opened in another unit" error when opening
                    /dev/null or /dev/tty twice
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: steven dot chapel at sbcglobal dot net
 GCC build triplet: i386-redhat-linux
  GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux


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


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

end of thread, other threads:[~2009-01-18  1:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-14 18:15 [Bug fortran/38122] New: "file already opened in another unit" error when opening /dev/null or /dev/tty twice steven dot chapel at sbcglobal dot net
2008-11-14 18:41 ` [Bug fortran/38122] " kargl at gcc dot gnu dot org
2008-11-14 20:20 ` steve dot chapel at a2pg dot com
2008-11-14 20:56 ` kargl at gcc dot gnu dot org
2008-11-15 10:43 ` burnus at gcc dot gnu dot org
2008-11-15 15:00 ` jvdelisle at gcc dot gnu dot org
2008-11-15 17:30 ` kargl at gcc dot gnu dot org
2008-11-15 19:15 ` jvdelisle at verizon dot net
2008-11-15 20:53 ` jvdelisle at gcc dot gnu dot org
2009-01-05 20:23 ` mikael at gcc dot gnu dot org
2009-01-18  1:33 ` 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).