Paul Eggert writes: > On 2023-03-05 03:25, Po Lu wrote: >> I'd like to see the discussion where it was concluded that the >> cleanup attribute is absolutely required. It doesn't do fancy things >> like clean up after Lisp signals under the hood, so all of the cleanup >> can be done in portable C as well. > > As I recall there wasn't much discussion, unfortunately. I very vaguely recall > that there was some worry that Emacs modules would be written in C++, and that > they would invoke Elisp code, and that this meant it'd be hard to do the > cleanup in portable C. > > One option that was discussed was to require a C++ compiler to compile > emacs-modules.cc (i.e., to write the emacs-modules interface in C++). I expect > this would have addressed the cleanup issue in a different way. But RMS was > very strongly against requiring a C++ compiler. Depending on how long ago that was, it might be worth reconsidering. GCC has been C++ for a decade now, for instance, so C++ compilers are likely fairly widespread. One could make the case that using portable C++ in addition to portable C is a more portable way to do cleanups than GNU C cleanups. If still undesirable, I strongly suggest at least using GNU C cleanups. They are a decent workaround. > You may find this patch useful: > > https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg01075.html -- Arsen Arsenović