brewster@uvm-cs.UUCP (Chip Brewster) (08/28/85)
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!