Path: utzoo!attcan!uunet!telxon!gorpong From: gorpong@telxon.UUCP (Gordon C. Galligher) Newsgroups: comp.misc Subject: Re: The "evil" GOTO (Was: 25 Years of BASIC) Summary: No non-local goto in C (clarification) Message-ID: <47@telxon.UUCP> Date: 12 May 89 17:45:23 GMT References: <137@quad.uucp> <13507@lanl.gov> Reply-To: gorpong@telxon.UUCP (Gordon C. Galligher) Organization: Telxon Corporation, Akron Ohio Lines: 29 In article <13507@lanl.gov> jlg@lanl.gov (Jim Giles) writes: >From article <137@quad.uucp>, by dts@quad.uucp (David T. Sandberg): >> [...] >> Also, GOTOs can jump to any part of the program which they like: >> different functions, different modules, etc. [...] > >Maybe they can in C. But in MOST programming languages, a statement >label is _purely_ local. Not even Fortran allows GOTO to refer to a No they can't. In C a goto can only be used within a function declaration. Some C libraries do employ the setjmp/longjmp sequence, but that deals with actually restoring the stack to what it was when the setjmp() was called, and it even puts the restriction that the function which called the setjmp() had still better be active when the longjmp() is called, or likely all h*&# will break loose. I know that comp.misc doesn't deal explicitly with C code (as someone deftly mentioned earlier by posting LISP source), but I also don't want someone who doesn't know C that well reading "Maybe they can in C" when they can't :-). ....I now return you to your regularly scheduled flame fest.... -- Gordon. -- Gordon C. Galligher <|> ...!uunet!telxon!gorpong <|> gorpong@teleng.uucp.uu.net Telxon Corporation <|> "Captain, I hardly believe that insults are within your Akron, Ohio, 44313 <|> prerogative as my commanding officer" - Spock (216) 867-3700 (3512)<|> (City on the Edge of Forever (Starring Joan Collins))