public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "Joost.VandeVondele at mat dot ethz.ch" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/61933] Inquire on internal units
Date: Fri, 16 Jan 2015 07:04:00 -0000	[thread overview]
Message-ID: <bug-61933-4-drynEcdbsb@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61933-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61933

--- Comment #7 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> ---
Hi Jerry,

thanks for the fix, but this seems to break code to find a free unit, like
such:

MODULE M
CONTAINS
  FUNCTION get_unit_number(file_name) RESULT(unit_number)

    CHARACTER(LEN=*), INTENT(IN), OPTIONAL   :: file_name
    INTEGER                                  :: unit_number

    INTEGER                                  :: ic, istat, nc
    LOGICAL                                  :: exists, is_open

    ! Get a new unit number
    DO unit_number=10,100
       INQUIRE (UNIT=unit_number,EXIST=exists,OPENED=is_open,IOSTAT=istat)
       IF (exists.AND.(.NOT.is_open).AND.(istat == 0)) RETURN
    END DO

    unit_number = -1

  END FUNCTION get_unit_number
END MODULE

USE M
  write(6,*) "unit to use: ",get_unit_number("foo.dat")
END


This will now always return -1, while it used to return a free unit.


  parent reply	other threads:[~2015-01-16  7:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28  8:13 [Bug fortran/61933] New: " Joost.VandeVondele at mat dot ethz.ch
2014-08-28  4:09 ` [Bug fortran/61933] " jvdelisle at gcc dot gnu.org
2015-01-15  3:52 ` jvdelisle at gcc dot gnu.org
2015-01-15  3:58 ` jvdelisle at gcc dot gnu.org
2015-01-15  4:06 ` jvdelisle at gcc dot gnu.org
2015-01-15  4:08 ` jvdelisle at gcc dot gnu.org
2015-01-16  7:04 ` Joost.VandeVondele at mat dot ethz.ch [this message]
2015-01-16 15:07 ` jvdelisle at gcc dot gnu.org
2015-01-16 15:22 ` Joost.VandeVondele at mat dot ethz.ch
2015-01-16 15:42 ` jvdelisle at gcc dot gnu.org
2015-01-16 15:52 ` Joost.VandeVondele at mat dot ethz.ch
2015-01-19  5:14 ` jvdelisle at gcc dot gnu.org
2015-01-19  7:25 ` Joost.VandeVondele at mat dot ethz.ch
2015-01-19 13:03 ` [Bug fortran/61933] [5 Regression] " Joost.VandeVondele at mat dot ethz.ch
2015-01-23  2:00 ` jvdelisle at gcc dot gnu.org
2015-01-23  2:01 ` jvdelisle at gcc dot gnu.org
2015-01-23  2:07 ` jvdelisle at gcc dot gnu.org
2015-01-23  2:09 ` jvdelisle at gcc dot gnu.org
2015-01-23  3:39 ` jvdelisle at gcc dot gnu.org
2015-02-01 13:11 ` jvdelisle at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-61933-4-drynEcdbsb@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).