Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site sjuvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!astrovax!sjuvax!bbanerje From: bbanerje@sjuvax.UUCP (B. Banerjee) Newsgroups: net.lang.f77,net.bugs.4bsd Subject: Re: Subroutine bug with 4.2 BSD F77. Message-ID: <3180@sjuvax.UUCP> Date: Mon, 16-Jun-86 12:39:12 EDT Article-I.D.: sjuvax.3180 Posted: Mon Jun 16 12:39:12 1986 Date-Received: Thu, 19-Jun-86 08:02:50 EDT References: <3174@sjuvax.UUCP> Reply-To: bbanerje@sjuvax.UUCP (B. Banerjee) Distribution: net Organization: St. Joseph's University, Phila. PA. Lines: 44 Xref: watmath net.lang.f77:551 net.bugs.4bsd:2178 Summary: It's not a bug In article <3174@sjuvax.UUCP> I wrote: >> Description: >> >> User defined functions always return a value of 0 (including >> logical functions). >> >> Repeat-By: >> >> Compile and execute the following program. >> ============================================================ >> integer i >> i = 1 >> print *, bug(i) >> stop >> end >> >> >> integer function bug(i) >> integer i >> >> bug = 2 >> return >> end >> >> Fix: >> Hopefully fixed in 4.3 BSD. I'm sorry people. As has been pointed out to me by various people, one needs a forward declaration of bug in order to over-ride the default typing of Fortran. This was brought to my attention by a local user. My previous experience with Fortran has been with Fortran IV in the old days of punched cards. Both the compilers I used previously would have accepted the above without problem. I guess that they just used extensions. My apologies to anyone inconvenienced by the above posting. Regards, Binayak Banerjee {allegra | astrovax | bpa | burdvax}!sjuvax!bbanerje bbanerje@sju.edu