Path: csiph.com!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: goto considered helpful Date: Fri, 13 Dec 2024 10:11:56 -0800 Organization: None to speak of Lines: 33 Message-ID: <87o71fv4er.fsf@nosuchdomain.example.com> References: <87wmg5x4b1.fsf@nosuchdomain.example.com> <87jzc5wx3s.fsf@nosuchdomain.example.com> <87frmtwuzq.fsf@nosuchdomain.example.com> <20241212144454.00003b83@yahoo.com> <87wmg4vaeb.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 13 Dec 2024 19:11:59 +0100 (CET) Injection-Info: dont-email.me; posting-host="66c77e050ec176338b057ef443530fd1"; logging-data="3732068"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/kv0Wp3m0hCXt8k/ZewFc9" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:JBoR1VPIm8mO/odyOTOKlkyJlVE= sha1:FcW0/J2gv4qSuqgXbPMkXyId9zc= Xref: csiph.com comp.lang.c:389641 bart writes: > On 13/12/2024 13:19, David Brown wrote: >> On 13/12/2024 12:12, bart wrote: [...] >>> I've had a quick look through my codebases (not C), and I couldn't >>> see an example of a numbered break. All I could find was the >>> equivalant of: >>> >>>     break              # the vast majority >>>     break all >>> >>> The latter breaks out of the outermost loop. >>> >> So you have a feature (numbered breaks) in your language that you >> never use, but have been recommending here as a useful addition to >> C? > > I'm saying that if you don't have the general feature, then the more > limited one might be worth considering, as it will take care of most > of the use-cases not covered by break. In current C, we don't have either feature. I suggest that covering *most* of the use-cases would not be good enough. Adding your "break all" to C (defining it in the standard and implementing it in compilers) would not be significantly easier than adding "break LABEL". I see no point in adding a partial feature when a more complete feature is (a) just as easy, and (b) has ample precedent in other languages. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */