Deutsch English Français Italiano |
<vjdde8$1q2to$2@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: bart <bc@freeuk.com> Newsgroups: comp.lang.c Subject: Re: question about linker Date: Thu, 12 Dec 2024 01:14:48 +0000 Organization: A noiseless patient Spider Lines: 38 Message-ID: <vjdde8$1q2to$2@dont-email.me> References: <vi54e9$3ie0o$1@dont-email.me> <vifcll$1q9rj$1@dont-email.me> <vifiib$1s07p$1@dont-email.me> <87ldwx10gv.fsf@bsb.me.uk> <vimtt4$27vv$1@dont-email.me> <86ser1kgp5.fsf@linuxsc.com> <vit69t$1qfgg$1@dont-email.me> <87ldwtzlc0.fsf@nosuchdomain.example.com> <vitjgg$1tukq$2@dont-email.me> <vj1bss$325uo$1@dont-email.me> <vj1h4i$335q1$2@dont-email.me> <vj1mhi$34p7h$1@dont-email.me> <vj1prj$35je4$1@dont-email.me> <vj7dup$he7i$1@dont-email.me> <vjasuj$17uod$1@dont-email.me> <vjc87h$1apid$1@paganini.bofh.team> <vjcbe1$1jns0$1@dont-email.me> <87wmg5x4b1.fsf@nosuchdomain.example.com> <vjd96b$1pbed$1@dont-email.me> <87jzc5wx3s.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 12 Dec 2024 02:14:48 +0100 (CET) Injection-Info: dont-email.me; posting-host="021d91925d3f1b965194e346b20c998a"; logging-data="1903544"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+5plAsiQGtGd0WUD2TwAwr" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:K7ws/ZT0zAVE01Bm1gjqE1j6XBg= In-Reply-To: <87jzc5wx3s.fsf@nosuchdomain.example.com> Content-Language: en-GB Bytes: 3227 On 12/12/2024 00:42, Keith Thompson wrote: > bart <bc@freeuk.com> writes: > > Are you bothered by the fact that "break" applies to all three > kinds of iteration statements (while, do, for)? No. But 'switch' isn't iteration. (In my language, there /is/ a looping switch statement. That uses the same loop controls as regular loops. Those are not allowed in normal switch.) > Sure, the fact that "break" is overloaded can be slightly > inconvenient. So can the fact that "break" only exits the > *innermost* enclosing loop or switch. > > Using two different keywords (which, to be clear, is unlikely to > happen in any language called "C") would only solve a small part of > the problem. What I'd really like to see is a mechanism for "break" > (or "continue") to apply to a *named* enclosing construct, something > I've found very useful in other languages that support it. It would > provide an easy solution to the scenario you mentioned above. My experience of multi-level break is that there are two main use-cases: * Used in the current loop only (not necessarily the innermost to an observer). This is the most common * Used to exit the outermost loop So to support these, named or even numbered loops are not necessary. (Eg. I use 'exit' or 'exit all'.) Having named labels do have some advantages, such as being absolute while indices are relative. But sometimes you need an absolute reference when refactoring and sometimes you want it relative. If duplicating within the same function, then you also need to think about scope rules for those named labels.