public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/56675] New: I/O: Check edit descriptors with READ/WRITE used in FORMAT statements
Date: Thu, 21 Mar 2013 12:34:00 -0000	[thread overview]
Message-ID: <bug-56675-4@http.gcc.gnu.org/bugzilla/> (raw)


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

             Bug #: 56675
           Summary: I/O: Check edit descriptors with READ/WRITE used in
                    FORMAT statements
    Classification: Unclassified
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


https://groups.google.com/forum/#!topic/comp.lang.fortran/BxWaYSkmV2w

The following code shows that the special checks for READ/WRITE/PRINT do not
get checked for with FORMAT but only with a string.

Seemingly, the format is checked when FORMAT is encountered - one should
consider to do additionally a check if READ/WRITE/PRINT is used.

[The latter becomes even more useful when looking at the types of the arguments
(e.g. "a" edit descriptor with a "real" expression/variable). However,
currently this is only checked at run time. For compile time, it should be
doable if the I/O list doesn't contain nonconst-shape arrays and no
io-do-lists.]




  implicit none
  integer :: z

! OK: Diagnosed.  (Side note: Also diagnosed by NAG.)
!  character(len=*), parameter :: str = '(i0)'
!  read  (*,str) z ! Positive width required in format string
!  read  (*,"(i0)") z ! "Positive width required in format string"

! Not diagnosed but diagnosable. (Also not diagnosed by NAG.)
  read  (*, 99) z ! 'Wrongly' accepted (at compile time)
  99 FORMAT (i0)  ! (gives error at run time)

! RFC: Validly rejected or not? (Note: Also rejected by NAG)
!   read (*, 100) z   ! Rejected at run time (but not used;
!   100 FORMAT (i2,i0)! may it reject it or not?)
end


             reply	other threads:[~2013-03-21 12:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-21 12:34 burnus at gcc dot gnu.org [this message]
2014-01-14 23:15 ` [Bug fortran/56675] " dominiq at lps dot ens.fr
2020-07-25  9:45 ` dominiq at lps dot ens.fr

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-56675-4@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).