Path: utzoo!utgpu!water!watmath!clyde!bellcore!faline!ulysses!allegra!princeton!udel!gatech!hao!ames!necntc!linus!philabs!spectrum!mrs From: mrs@spectrum.UUCP Newsgroups: comp.lang.fortran Subject: Re: bug fix for f77 (4,3 bsd) entry statement ? Keywords: f77, entry, bug Message-ID: <3164@briar.Philips.Com> Date: 17 Jan 88 01:45:58 GMT References: <3124@briar.Philips.Com> <1290@vu-vlsi.UUCP> Sender: news@philabs.Philips.Com Reply-To: mrs@spectrum.UUCP (Mark R. Simpson) Organization: Philips Laboratories, Briarcliff Manor, NY Lines: 54 Posted: Sat Jan 16 20:45:58 1988 In my original article, I noted a bug in the UNIX 4.3 f77 compilier with the entry statement. A number of people replied with suggestions on how to circumvent the difficulty, but they all involved either 1) changing the calling sequence, or 2) not using the entry statement. The simplist modification (of cousre I maybe biased since it is the one I used) is to make use of fortran's "call by location" argument passing. Specifically, the declaration character chas*(*) is "equivalent" (and I use the form loosely) to character chas*1 since in both instances the location of chas is passed to the calling routine. Consequently, I neither have to change the calling sequence or remove the entry statement and the code is compatible across machines/operating systems. I agree, nevertheless, that the use of the entry statement goes against the grain of structured programming. Here is the revised subroutine which now compilies. subroutine getc(char) c old statement c character char,chas*(*) c new statement character char,chas*1 integer n c return entry gets(chas,n) return end Mark R. Simpson Philips Laboratories uunet!philabs!mrs North American Philips Corporation or Briarcliff Manor, NY 10510 mrs@philabs.philips.com (914) 945-6163 Mark R. Simpson Philips Laboratories uunet!philabs!mrs North American Philips Corporation or Briarcliff Manor, NY 10510 mrs@philabs.philips.com (914) 945-6163