Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bridge2!3comvax!tymix!cirrusl!sunscreen!dhesi From: dhesi@sunscreen.UUCP (Rahul Dhesi) Newsgroups: comp.lang.c Subject: Re: The final word on GOTO Message-ID: <973@cirrusl.UUCP> Date: 13 Oct 89 07:11:17 GMT References: <20324@<1989Sep14| <225800222@uxe.cso.uiuc.edu| <4208@cbnewsh.ATT.COM| <6490@ficc.uu.net| <566@sunquest.UUCP> Sender: news@cirrusl.UUCP Reply-To: dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) Organization: Cirrus Logic Inc. Lines: 41 In article <566@sunquest.UUCP> ggg@sunquest.UUCP (Guy Greenwald) writes: >/* Really: */ > case whatever: > special-code...; > goto common; >/* Is no clearer than: */ > case whatever: > special-code...; > common(); > break; Possible counter-example: int counterexample(...) { ... other stuff ... switch (yyy) { case x: ... other stuff ... goto err_ret; case y: ... other stuff ... goto err_ret; case other-stuff: ... other stuff ... break; ... } return 0; /* no need to close file; return success */ common: errno = last_error;/* save latest error for caller's sake */ if (last_error != CE_NOFILE) fclose(f); /* close file if still open */ return -1; /* return error code */ } /* counterexample() */ Rahul Dhesi UUCP: oliveb!cirrusl!dhesi