Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!paris.Berkeley.EDU!mcgrath From: mcgrath@paris.Berkeley.EDU (Roland McGrath) Newsgroups: gnu.gcc Subject: Re: address of labels Message-ID: Date: 29 Apr 89 02:42:00 GMT References: <8904282319.AA08492@riunite.aca.mcc.com> <41161@oliveb.olivetti.com> Sender: usenet@agate.BERKELEY.EDU Distribution: gnu Organization: Hackers Anonymous International, Ltd., Inc. (Applications welcome) Lines: 33 In-reply-to: chase@Ozona.orc.olivetti.com's message of 29 Apr 89 01:09:10 GMT You can fake a C jump table with setjmp/longjmp. It's not too pretty, but it'll do it: foo() { jmp_buf env; switch (setjmp(env)) { case 0: /* The initial setjmp call. */ break; case 1: /* Do stuff, or goto somewhere. */ case 2: /* ... */ break; } /* ... */ if (do_foo2) longjmp(env, 2); /* ... */ if (do_foo98) longjmp(env, 98); } -- Roland McGrath Free Software Foundation, Inc. roland@wheaties.ai.mit.edu, mit-eddie!wheaties.ai.mit.edu!roland Copyright 1989 Roland McGrath, under the GNU General Public License, version 1.