🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3445

Re: Nested functions (was: Re: GOTO single exit point)

#3445
From: Fergus Henderson
Date: Sun, 01 Oct 1995 17:16
32 lines
2304 bytes
meissner@cygnus.com (Michael Meissner) writes:

>kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763) writes:
>
>| Also: the C++ committee considered and rejected nested functions.  I
>| believe that at least part of the reason for the rejection was that
>| there exist (or might exist) architectures on which trampolines cannot
>| be implemented, and in this case, function pointers become more
>| complex, which violates the ``you only pay for what you use''
>| principle.
>
>Trampolines are probably the buggiest feature of the GNU C compiler. 

That may be so, but that does not imply that it need be so.

>You have
>to go through incredible hair on many machines, particularly RISC machines with
>Harvard architectures.  Often times, you have to make a system call in order to
>create the trampolines (since there is no user callable instruction sequence to
>correctly flush the caches).  Sometimes, the machine + OS just gives absolutely
>no way to implement trampolines (DEC's Ultrix on MIPS based DECstations comes
>to mind).

There are definitely trampoline-based ways of implementing nested
functions which work even on mips-dec-ultrix.  Perhaps if I ever get
the time I will do so.

-- 
Fergus Henderson             |  "Australia is the richest country in the world,
fjh@cs.mu.oz.au              |   according to a new system of measuring wealth
http://www.cs.mu.oz.au/~fjh  |   announced by the World Bank yesterday."
PGP: finger fjh@128.250.37.3 |  - Melbourne newspaper "The Age", 18 Sept 1995.
Technical Details
Message-ID: <9527503.20627@mulga.cs.mu.OZ.AU>
Path: arc1-ca.pugleaf.net!munta.cs.mu.OZ.AU!fjh
References: <3vn1ht$kj8@martha.utk.edu> <41cke4$gtd@sparcserver.lrz-muenchen.de> <41glno$3a0@caip.rutgers.edu> <41iebe$kec@news0.rain.rg.net> <41pm80$skp@inferno.mpx.com.au> <DE02nC.B58@eskimo.com> <41t0sb$15e@news0.rain.rg.net> <DE6G2z.JJD@crdnns.crd.ge <43v2a8$b2g@hermes.acs.unt.edu> <KANZE.95Sep25115042@slsvhdt.lts.sel.alcatel.de> <MEISSNER.95Sep25125022@tiktok.cygnus.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c,comp.lang.c
Path: arc1-ca.pugleaf.net!munta.cs.mu.OZ.AU!fjh
From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
Subject: Re: Nested functions (was: Re: GOTO single exit point)
Message-ID: <9527503.20627@mulga.cs.mu.OZ.AU>
Sender: news@cs.mu.OZ.AU (CS-Usenet)
Organization: Computer Science, University of Melbourne, Australia
References: <3vn1ht$kj8@martha.utk.edu>  <41cke4$gtd@sparcserver.lrz-muenchen.de> <41glno$3a0@caip.rutgers.edu>  <41iebe$kec@news0.rain.rg.net> <41pm80$skp@inferno.mpx.com.au>  <DE02nC.B58@eskimo.com> <41t0sb$15e@news0.rain.rg.net>  <DE6G2z.JJD@crdnns.crd.ge <43v2a8$b2g@hermes.acs.unt.edu>  <KANZE.95Sep25115042@slsvhdt.lts.sel.alcatel.de> <MEISSNER.95Sep25125022@tiktok.cygnus.com>
Date: Sun, 1 Oct 1995 17:16:25 GMT