Path: utzoo!mnetor!uunet!husc6!bbn!rochester!PT.CS.CMU.EDU!sei!sei.cmu.edu!firth From: firth@sei.cmu.edu (Robert Firth) Newsgroups: comp.lang.fortran Subject: Re: entry statements Message-ID: <3963@aw.sei.cmu.edu> Date: 28 Jan 88 14:43:16 GMT References: <4266@eagle.ukc.ac.uk> Sender: netnews@sei.cmu.edu Reply-To: firth@bd.sei.cmu.edu.UUCP (PUT YOUR NAME HERE) Organization: Carnegie-Mellon University, SEI, Pgh, Pa Lines: 24 Keywords: fortran 77 In article <4266@eagle.ukc.ac.uk> trh@eagle.ukc.ac.uk (T.R.Hopkins) writes: >I want to be able to refer to an external function by two >different names without the overhead of duplicated code. > >The following seems to work on all compilers I've tried REAL FUNCTION NAME1(arg list) REAL NAME2 ENTRY NAME2(same arg list as name1) . . . NAME1 = result END >i.e. nowhere do I assign a value to NAME2. Is this legal Fortran 77? Yes. See ANSI X3.9-1978 15.5.1 "The symbolic name of a function subprogram OR an associated entry name of the same type... must become defined..." In other words, you may indifferently assign to either NAME1 or NAME2.