Article View: comp.std.c
Article #3400Re: GOTO single exit point (was: Re: How to eliminate GOTO?)
From: a-cnadc Dann Corbit
Date: Tue, 05 Sep 1995 18:58
Date: Tue, 05 Sep 1995 18:58
11 lines
1388 bytes
1388 bytes
In article <small-0109951141310001@155.34.60.159>, small@ll.mit.edu says... > I prefer multiple return statements to multiple goto statements. . I have a dreaded fear of multiple return statements. I have seen an enourmous number of memory leaks caused by having an exit w/o cleanup. Often, it is not the original author of the routine, but someone maintaining it. One solution that sometimes works to eliminate both is to insert a function call at the goto branch request instead of a goto. That way the branch to & back are implicit in the call and easy to understand. -- The opinions expressed in this message are my own personal views and do not reflect the official views of Microsoft Corporation.
Technical Details
Message-ID:
<42i6l7$jdk@news2100.microsoft.com>Path:
arc1-ca.pugleaf.net!news.microsoft.com!newsReferences:
<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.com> <small-0109951141310001@155.34.60.159>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.microsoft.com!news From: a-cnadc (Dann Corbit) Newsgroups: comp.std.c,comp.lang.c Subject: Re: GOTO single exit point (was: Re: How to eliminate GOTO?) Date: 5 Sep 1995 18:58:47 GMT Organization: Microsoft Corporation Message-ID: <42i6l7$jdk@news2100.microsoft.com> 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.com> <small-0109951141310001@155.34.60.159> NNTP-Posting-Host: 157.57.171.202 Mime-Version: 1.0 X-Newsreader: WinVN 0.93.14