[net.lang.c] Multiple function entries in C

levy@ttrdc.UUCP (Daniel R. Levy) (11/13/85)

A while ago, I posted a query to net.lang.c asking if there was a facility
in C to achieve multiple function entries such as is possible in fortran.  I
received a few replies/suggestions/flames and saw some more of the same in
net.lang.c.  The consensus was that to do this 'literally' was impossible in
C, and I have no reason to doubt it (no special construct exists in C, as
in fortran, to allow this, though obviously it is possible in assembler).
The suggestions were of two classes: use two or more functions instead of
one, or to pass extra argument(s) to indicate what part of the function should
be executed.  There were also a couple or so flames that this was lousy pro-
gramming practice.  A couple or so people pointed out the existence of the
reserved keyword "entry" in the early C specifications, and surmised on its
purpose.  (But for that matter, "fortran" was also a reserved keyword on
some machines--as was "asm", according to T.F.M., if I R. it correctly.)

In connection with the query about multiple function-entries, I wish to
publicly acknowledge replies by the following:

ihnp4!ukma!ukecc!edward (Edward C. Bennett)
ihnp4!drutx!qwerty (Brian Jones aka  {ihnp4,}!drutx!qwerty  @  AT&T-IS, Denver)
ihnp4!uw-beaver!entropy!dataio!bright (Walter Bright)
seismo!UCLA-LOCUS.ARPA!bilbo.niket  ("Niket K. Patwardhan")
seismo!brl-tgr!tgr!cottrell@NBS-VMS.ARPA (COTTRELL, JAMES)
seismo!hadron!jsdy (Joseph S. D. Yao)

-- 
 -------------------------------    Disclaimer:  The views contained herein are
|       dan levy | yvel nad      |  my own and are not at all those of my em-
|         an engihacker @        |  ployer or the administrator of any computer
| at&t computer systems division |  upon which I may hack.
|        skokie, illinois        |
 --------------------------------   Path: ..!ihnp4!ttrdc!levy

pdg@ihdev.UUCP (P. D. Guthrie) (11/13/85)

There has been mention of the `entry' keyword as a possible method of
implementing multiple function entries in C.  I would like to clarify
its use (or in this case lack thereof).

	The entry key word was never implemented and is no longer
reserved.

	-- AT&T Bell Laboratories Technical Journal V.63 No 8 Part 2
October 1984, L. Rosler, "The Evolution of C - Past and Future", p.1691

Who knows how long this will take to "free up" the word in most C
compilers, though.

					Paul Guthrie

henry@utzoo.UUCP (Henry Spencer) (11/17/85)

> Who knows how long this will take to "free up" the word in most C
> compilers, though.

Actually, some C compilers had it "freed up" all along.  The Ritchie
compiler never thought it was anything special, as witness one or two
pieces of V7 software that had functions named "entry"...
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry

sam@delftcc.UUCP (Sam Kendall) (11/22/85)

In article <6146@utzoo.UUCP>, henry@utzoo.UUCP (Henry Spencer) writes:
> Actually, some C compilers had it "freed up" all along.  The Ritchie
> compiler never thought it was anything special, as witness one or two
> pieces of V7 software that had functions named "entry"...

The pcc never thought it was anything special either; in System V, some
structure in a header file (a.out.h?) has a member called "entry".

----
Sam Kendall
Delft Consulting Corp.
(212) 243-8700
{allegra, seismo!cmcl2, ihnp4}!delftcc!sam