🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.f77
Article #258

Dummy procedure problem

#258
From: Chip Brewster
Date: Tue, 27 Aug 1985 21:34
61 lines
2458 bytes
I was trying to pass a subroutine to another with the following test code.
-----------------------------------------------------------------------
	implicit double precision (a-h,o-z)
	external ext
	call sub(ext,x)
	write (6,10) x
10	format (/' x = ',1pd10.3)
	stop
	end
c
c
c
c
	subroutine sub(f,a)
	implicit double precision (a-h,o-z)
c
c  Compiler gives warning if 'f' is not declared external here.
c	external f
	call f(a)
	return
	end
c
c
c
c
	subroutine ext(b)
	implicit double precision (a-h,o-z)
	b = 1.234d0
	return
	end
-----------------------------------------------------------------------
Can someone tell me why the UNIX 4.2BSD f77 compiler gives the following
warning message ?

Warning on line 17 of test.f: Dummy procedure not declared EXTERNAL. Code may be wrong.

I thought a passed procedure only had to be declared external in the calling
procedure.
If this is not a bug, what is the compiler trying to warn me of ?
By the way, the program still seems to execute properly.

                                             Thank you,
             /\
        /\  /  \                             Chip Brewster
       /  \/    \/\                          University of Vermont
      /    \    /  \                         decvax!dartvax!uvm-cs!brewster
      +     m' m'    +                       brewster@uvm-cs
     / `m    m' `m  /
    +--+--+--+--+--+
    Vermont, Green Mountains and lots 'uv cows!
-- 
                                             Thank you,
             /\
        /\  /  \                             Chip Brewster
       /  \/    \/\                          University of Vermont
      /    \    /  \                         decvax!dartvax!uvm-cs!brewster
      +     m' m'    +                       brewster@uvm-cs
     / `m    m' `m  /                        (802) 656-3330  ext. 33
    +--+--+--+--+--+
    Vermont, Green Mountains and lots 'uv cows!
Technical Details
Message-ID: <424@uvm-cs.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!linus!decvax!dartvax!uvm-gen!uvm-cs!brewster

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site uvm-cs.UUCP
Path: arc1-ca.pugleaf.net!utzoo!linus!decvax!dartvax!uvm-gen!uvm-cs!brewster
From: brewster@uvm-cs.UUCP (Chip Brewster)
Newsgroups: net.lang.f77
Subject: Dummy procedure problem
Message-ID: <424@uvm-cs.UUCP>
Date: Tue, 27-Aug-85 17:34:51 EDT
Article-I.D.: uvm-cs.424
Posted: Tue Aug 27 17:34:51 1985
Date-Received: Thu, 29-Aug-85 21:59:54 EDT
Organization: University of Vermont
Lines: 61