public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sgk at troutmask dot apl.washington.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/61069] Gfortran allows functions to be called as subroutines when defined in a separate source file
Date: Tue, 06 May 2014 18:43:00 -0000 [thread overview]
Message-ID: <bug-61069-4-6op5uu0Lxg@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61069-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61069
--- Comment #8 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Tue, May 06, 2014 at 06:17:42PM +0000, tristanmoody at gmail dot com wrote:
> (In reply to Steve Kargl from comment #5)
> > The Fortran code conforms to the Fortran standard! Why do you continue to
> > claim that it is nonconforming invalid code. What the linker does to
> > the object code after the Fortran processor has created the three object
> > files is beyond the scope of the Fortran standard.
>
> Not to belabor the point, but that is simply not correct. Using the Fortran
> 2008 standard for reference, that code violates syntax rule R1220, constraint
> C1226, of clause 12.5.1. --
>
> R1220 call-stmt is CALL procedure-designator [ ( [ actual-arg-spec-list ] ) ]
> C1226 (R1220) The procedure-designator shall designate a subroutine.
>
program foo
integer i
external bar, baz
i=0
call bar(i)
call baz(i)
end
This is standard conforming Fortran. When gfortran compiles
this code, there is no way for gfortran to know that bar
or baz is not a subroutine. In fact, bar and baz may not have
been written when the main program is compiled. It is the
programmer's responsibility to get the semantics right.
next prev parent reply other threads:[~2014-05-06 18:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-61069-4@http.gcc.gnu.org/bugzilla/>
2014-05-05 22:33 ` dominiq at lps dot ens.fr
2014-05-05 23:30 ` tristanmoody at gmail dot com
2014-05-06 11:30 ` kargl at gcc dot gnu.org
2014-05-06 17:38 ` sgk at troutmask dot apl.washington.edu
2014-05-06 17:42 ` pinskia at gcc dot gnu.org
2014-05-06 18:17 ` tristanmoody at gmail dot com
2014-05-06 18:43 ` sgk at troutmask dot apl.washington.edu [this message]
2014-05-06 18:53 ` tristanmoody at gmail dot com
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-61069-4-6op5uu0Lxg@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).