🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #53271

Re: Does gcc 2.0 support computed gotos?

#53271
From: Toshi Morita
Date: Sun, 23 Feb 1992 08:39
29 lines
1267 bytes

jhostet@slayer.mit.edu (Mat Hostetter) writes:

>I saw in the GNU status report that "C has been extended to support
>nested functions, nonlocal gotos, and taking the address of a label."
>
>Will there be any way to have an array of label-pointers and dispatch to
the
>one I want?  (eg, "goto label_array[x]".)  (I basically need a switch that
does
>no bounds checking, for a really speed-intensive loop.)

Maybe I'm missing something, but doesn't stock C handle this?

Something like this:

void (*func[32])(void);

func[0] = func0;
func[1] = func1;
func[2] = func2;

...

(*func[x])();

Toshi Morita
tm@well.sf.ca.us
Technical Details
Message-ID: <30150@well.sf.ca.us>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!pacbell!well!tm
References: <1992Feb21.023817.17703@athena.mit.edu> <1992Feb21.033356.18370@athena.mit.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,5fb12b206120b8ea
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-02-24 07:46:11 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!pacbell!well!tm
From: tm@well.sf.ca.us (Toshi Morita)
Newsgroups: gnu.gcc.help
Subject: Re: Does gcc 2.0 support computed gotos?
Message-ID: <30150@well.sf.ca.us>
Date: 23 Feb 92 08:39:27 GMT
References: <1992Feb21.023817.17703@athena.mit.edu> <1992Feb21.033356.18370@athena.mit.edu>
Organization: Whole Earth 'Lectronic Link, Sausalito, CA
Lines: 29