Sujet : Re: Opinions on `defer`?
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.cDate : 13. Jan 2025, 15:47:58
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <86y0ze6a8x.fsf@linuxsc.com>
References : 1 2 3 4 5 6
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
scott@slp53.sl.home (Scott Lurndal) writes:
Bonita Montero <Bonita.Montero@gmail.com> 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++'.