Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: Opinions on `defer`? Date: Mon, 13 Jan 2025 06:47:58 -0800 Organization: A noiseless patient Spider Lines: 22 Message-ID: <86y0ze6a8x.fsf@linuxsc.com> References: <87y0znpik1.fsf@gmail.com> <86sept85nz.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Mon, 13 Jan 2025 15:48:05 +0100 (CET) Injection-Info: dont-email.me; posting-host="9eea8443f476a77794ac96904ee9ae64"; logging-data="1932737"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+JHXyst8e5OXkm1GlCKWTkFlbAYzGLGuI=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:VTGfVBBBH5iWxRF0Arrejrfu7kA= sha1:JvmmB/rXp+BUTlC7Lji9STyZBY8= Xref: csiph.com comp.lang.c:390011 scott@slp53.sl.home (Scott Lurndal) writes: > Bonita Montero writes: > >> Am 09.01.2025 um 17:41 schrieb Scott Lurndal: >> >>>> Why ? >>> >>> If you want destructors, use c++. >> >> If you're stuck with plain C, something like defer would >> be a huge relief over gotos as used in the Linux kernel. > > Most C-code can be compiled with a C++ compiler, [...] That used to be true. These days the two languages have diverged enough so that it is no longer a good assumption. > I don't find the 'defer' proposal readable and I suspect it > may lead to more maintainability issues that simple gotos. Instead of calling it 'defer' it should be called 'goto++'.