Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: Taming The Switch-Statement
Date: Tue, 13 Oct 2026 09:10:43 -0700
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <86qzhth98c.fsf@linuxsc.com>
References: <119qf6l$2rmg3$1@dont-email.me> <11ac783$1bkuo$1@kst.eternal-september.org> <11ad5eq$1l8hg$1@dont-email.me> <11ad9fg$cjm0$4@dont-email.me> <11addhr$1oakb$1@dont-email.me> <11aduuk$cjlv$1@dont-email.me> <20261010220212.000063fd@yahoo.com> <11ae56o$cjlv$4@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> <86zewhhdep.fsf@linuxsc.com> <11aljoo$m15u$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Tue, 13 Oct 2026 16:10:44 +0000 (UTC)
Injection-Info: dont-email.me; logging-data="730664"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4DC9tFRWWLF3wWcd6zLMqrUcJO5gvI04="; posting-host="065d2eee2cd7241f5f1e4f229d8fc207"
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:WvRW30VakrH4IpknjzJx/ONczW4= sha1:lKKv51+98dLtxfEcge49KhoIZ9Y= sha256:bbC0iWDx4JGY2NIwt1gdo3FZt3mjiGdb8I8M9M0AbdE= sha1:IYTPGxDo68lflMwNQYO/Mf7KtvU= sha256:Oz5rRVrX79VkKzpTJeF0trzUj4YABIy12xAdjfohYIo=
Xref: csiph.com comp.lang.c:403112
bart writes:
> On 13/10/2026 15:40, Tim Rentsch wrote:
>
>> Michael S writes:
>>
>
>
>>> I thought that my comment is hard to misunderstand, but you proved
>>> me wrong. So I'd try to elaborate:
>>>
>>> switch() nested within loop is very common in my practice and I suppose
>>> in practice of everybody else.
>>>
>>> In my practice, but obviously not in practice of Tim Rentsch, it
>>> is sufficiently common to want to transfer control from point within
>>> such nested switch to point immediately following the containing loop.
>>
>> Let me clarify my earlier comment. I'm not surprised that people
>> routinely use switch() inside of loops. What did surprise me is the
>> statement that wanting to break out of the loop from inside the
>> switch() is "very common". Not happens occasionally; not happens
>> commonly or even just sufficiently commonly; not happens routinely;
>> but "very common". I am wondering now how common it actually is,
>> for switch() in general
>
> For switch in general is not meaningful: since this is about breaking
> out of a loop: a loop needs to be involved!
Please don't make the mistake of thinking the question I am
asking is the same as the question you are interested in
answering.