Multiple function entries in C

Daniel R. Levy levy at ttrdc.UUCP
Wed Nov 13 15:47:46 AEST 1985


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 at 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



More information about the Comp.lang.c mailing list