public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/96986] [8/9/10/11 Regression] Explicit interface required: volatile argument for ENTRY subroutine
Date: Sat, 02 Jan 2021 01:32:24 +0000	[thread overview]
Message-ID: <bug-96986-4-2nhzI2hG2a@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96986-4@http.gcc.gnu.org/bugzilla/>

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org
           Priority|P5                          |P4
             Status|WAITING                     |NEW

--- Comment #5 from kargl at gcc dot gnu.org ---
The code is valid.  Gfortran error message is bogus.  The pertinent
part of the Fortran standard is the last sentence here:

   If the ENTRY statement is in a subroutine subprogram, an additional
   subroutine is defined by that subprogram.  The name of the subroutine
   is entry-name. The dummy arguments of the subroutine are those
   specified in the ENTRY statement

The entry statement 'entry func_a()' in question has no dummy arguments.

The portion of the Fortran standard quoted in comment #2 clearly
does not apply.

Also note that the requirement of an explicit interface comes if a
programmer wants to call 'entry func_b(va)'.   Thus, the following
code is also conforming.

subroutine bar(va)
   integer, volatile :: va
   va = 42
end subroutine bar

program foo
   integer n
   interface
      subroutine bar(va)
         integer, volatile :: va
      end subroutine bar
   end interface
   call bar(n)
   print *, n
end program foo

  parent reply	other threads:[~2021-01-02  1:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-08 19:22 [Bug fortran/96986] New: [8 " foreese at gcc dot gnu.org
2020-09-09  6:44 ` [Bug fortran/96986] [8/9/10/11 " rguenth at gcc dot gnu.org
2020-12-14 12:49 ` dominiq at lps dot ens.fr
2021-01-01 20:04 ` anlauf at gcc dot gnu.org
2021-01-01 21:46 ` foreese at gcc dot gnu.org
2021-01-01 23:15 ` anlauf at gcc dot gnu.org
2021-01-02  1:32 ` kargl at gcc dot gnu.org [this message]
2021-01-02 19:53 ` anlauf at gcc dot gnu.org
2021-01-02 20:50 ` sgk at troutmask dot apl.washington.edu
2021-05-14  9:53 ` [Bug fortran/96986] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:18 ` rguenth at gcc dot gnu.org
2022-05-27  9:43 ` [Bug fortran/96986] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:41 ` jakub at gcc dot gnu.org
2023-07-07 10:38 ` [Bug fortran/96986] [11/12/13/14 " rguenth 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-96986-4-2nhzI2hG2a@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).