Article View: comp.lang.c
Article #456Re: Taming The Switch-Statement
From: Lawrence D’Oliveiro
Date: Fri, 16 Oct 2026 21:42
Date: Fri, 16 Oct 2026 21:42
13 lines
2434 bytes
2434 bytes
On Fri, 16 Oct 2026 15:24:01 -0000 (UTC), Waldek Hebisch wrote: > Concernig 'return', having it in place where all work inside > function is done help me to see flow control and avoids > complications. In case of search functions it means return from the > middle of the loop. IMO possible alternatives like flag variables or > break and retrun after loop are worse. Code tends to do a lot of dynamic resource allocation these days, and that requires cleanup. Doing a direct “return” from the middle of a function body doesn’t allow for that. Unless you use a GCC extension like “defer”, I suppose.
Technical Details
Message-ID:
<11au5ob$3m5co$2@dont-email.me>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<119qf6l$2rmg3$1@dont-email.me> <20261010230355.00005189@yahoo.com> <864iesjx6e.fsf@linuxsc.com> <11afvqt$2kloc$1@dont-email.me> <11ag37o$2ln0a$1@dont-email.me> <11agbsh$2pbk7$1@dont-email.me> <11aggaq$2qqh9$1@dont-email.me> <11agils$2s3tg$1@dont-email.me> <11agv1t$30q22$2@kst.eternal-september.org> <20261012220256.00003d07@yahoo.com> <11ajb95$3t8jj$1@dont-email.me> <20261012223144.00000f95@yahoo.com> <11akm9q$29tpl$1@paganini.bofh.team> <11am99u$ul56$2@dont-email.me> <11atfif$38b7p$1@paganini.bofh.team>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Lawrence D’Oliveiro <ldo@nz.invalid> Newsgroups: comp.lang.c Subject: Re: Taming The Switch-Statement Date: Fri, 16 Oct 2026 21:42:35 -0000 (UTC) Organization: A noiseless patient Spider Lines: 13 Message-ID: <11au5ob$3m5co$2@dont-email.me> References: <119qf6l$2rmg3$1@dont-email.me> <20261010230355.00005189@yahoo.com> <864iesjx6e.fsf@linuxsc.com> <11afvqt$2kloc$1@dont-email.me> <11ag37o$2ln0a$1@dont-email.me> <11agbsh$2pbk7$1@dont-email.me> <11aggaq$2qqh9$1@dont-email.me> <11agils$2s3tg$1@dont-email.me> <11agv1t$30q22$2@kst.eternal-september.org> <20261012220256.00003d07@yahoo.com> <11ajb95$3t8jj$1@dont-email.me> <20261012223144.00000f95@yahoo.com> <11akm9q$29tpl$1@paganini.bofh.team> <11am99u$ul56$2@dont-email.me> <11atfif$38b7p$1@paganini.bofh.team> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 16 Oct 2026 21:42:36 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3872152"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Uqv+ZBwv3RSmo/txLhvDR"; posting-host="b840a1f0e35f688ae1b391d11843e803" User-Agent: Pan/0.165 (Kostiantynivka) Cancel-Lock: sha1:7OmhrLwj8+9/g/Sj+NcFeM9IKDY= sha256:xrk9UeB4YEdm6JZMZtA6sQKFbIuLAFg46CsSswfz2Bk= sha1:dtKN/7n3cGRHVFlR4e7VBfHKDr8= sha256:NNHiVN4dXFXQKb9aE3BtEmRYD25vELidmmT8jWNnAYI= X-Received-Bytes: 2236