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.