From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arsen =?utf-8?Q?Arsenovi=C4=87?= Newsgroups: gmane.emacs.devel Subject: Re: Merging feature/android Date: Mon, 06 Mar 2023 12:12:52 +0100 Message-ID: <86ilfexhag.fsf@aarsen.me> References: <87edq7ztks.fsf.ref@yahoo.com> <83y1odc37g.fsf@gnu.org> <87cz5pwf9c.fsf@yahoo.com> <83edq5asb3.fsf@gnu.org> <875ybhvt4w.fsf@yahoo.com> <83356kbxnh.fsf@gnu.org> <87lekcvho4.fsf@yahoo.com> <83r0u4adgd.fsf@gnu.org> <87a60suknn.fsf@yahoo.com> <83356jafll.fsf@gnu.org> <87o7p7tz16.fsf@yahoo.com> <83sfej8v17.fsf@gnu.org> <87fsajtrrx.fsf@yahoo.com> <83o7p78ns8.fsf@gnu.org> <87y1obsamf.fsf@yahoo.com> <0100f288-fcc0-8b91-5f12-18bf22969e50@cs.ucla.edu> <87ttyzs8q1.fsf@yahoo.com> <253e9494-6f78-89b7-8f5f-9c2e8461d95a@cs.ucla.edu> <878rgaspvs.fsf@yahoo.com> <86bkl6z1sc.fsf@aarsen.me> <87mt4qqi2o.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19944"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Paul Eggert , Eli Zaretskii , emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 06 12:15:43 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pZ8oh-00052L-6L for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Mar 2023 12:15:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZ8oN-0005fp-C0; Mon, 06 Mar 2023 06:15:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZ8oJ-0005fF-Vh for emacs-devel@gnu.org; Mon, 06 Mar 2023 06:15:20 -0500 Original-Received: from mout-p-202.mailbox.org ([2001:67c:2050:0:465::202]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1pZ8oI-0005Hf-4c; Mon, 06 Mar 2023 06:15:19 -0500 Original-Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4PVbb509fFz9slh; Mon, 6 Mar 2023 12:15:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aarsen.me; s=MBO0001; t=1678101313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NnlM54Gk6Xiq5YBjUoQvwnowuOYKInG6/AIjzQ1ryUQ=; b=qnBKKvJJGA/1oh3UC4KTMghTq1gTYHQuzYyxi+IV9D2Awpo0lw1V0E9IMJOIBjr7d+WuuF i6/ZupNFPaRmfUlFqAF9BIUY9rTF3Q+ucbjQMWU4+ezVQTiTgXdh5E8RozAZiOGdaTb/H2 e5V+OizH/1atfSmMDcZhsNosz2z5OgFRWDP1H8Pq5b9v1byjNIxXTZOuQXPwE0jcQRqEAb QbHz4Gt/PbUPJoYtudWF+UDYgSs8fF3d6bLOo8y6ljtoBvIDV9Osd4VBHnfA+ox4LPAl8I rVjywSAziGqoOjbJ44zsgBZnPVRBc4WQ/hrYREf+yFKKkdV4a7DJQlm4aI6Uyg== In-reply-to: <87mt4qqi2o.fsf@yahoo.com> X-Rspamd-Queue-Id: 4PVbb509fFz9slh Received-SPF: pass client-ip=2001:67c:2050:0:465::202; envelope-from=arsen@aarsen.me; helo=mout-p-202.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304029 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Po Lu writes: > Arsen Arsenovi=C4=87 writes: > >> -fexceptions is useful if it is possible to get a call stack which >> invokes C++ through a C function through a C++ function, for instance, >> if the comparator of a qsort could throw. This provides the user of a >> given C API to gracefully handle thrown errors. Alternatively, it also >> allows the C API developers to (mostly) gracefully clean up when a C++ >> exception remains uncaught. This is why libc is compiled with >> -fexceptions for instance. >> >> __attribute__((cleanup)) will run cleanups during stack unwinding: > > Only if you build Emacs with -fexceptions. > >> =E2=80=98cleanup (CLEANUP_FUNCTION)=E2=80=99 >> The =E2=80=98cleanup=E2=80=99 attribute runs a function when the va= riable goes out >> of scope. This attribute can only be applied to auto function >> scope variables; it may not be applied to parameters or variables >> with static storage duration. The function must take one >> parameter, a pointer to a type compatible with the variable. The >> return value of the function (if any) is ignored. >> >> If =E2=80=98-fexceptions=E2=80=99 is enabled, then CLEANUP_FUNCTION= is run during >> the stack unwinding that happens during the processing of the >> exception. Note that the =E2=80=98cleanup=E2=80=99 attribute does = not allow the >> exception to be caught, only to perform an action. It is undefined >> what happens if CLEANUP_FUNCTION does not return normally. >> >> IMO, the price of exceptions is overblown, so it could be worthwhile >> adopting this, if I understand the context right. > > If a C++ exception is thrown inside a module function, then we should > IMO just let everything blow up. How are they different from any other > kind of unexpected error in a dynamic module, such as for instance an > arithmetic trap, memory access error, or perhaps a Pascal exception? I agree that it is unnecessary to support them. The context that I took to understand is specifically wanting to support C++ modules. If that is not the case, then -fexceptions is not worth enabling, indeed. =2D-=20 Arsen Arsenovi=C4=87 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iOYEARYKAI4WIQT+4rPRE/wAoxYtYGFSwpQwHqLEkwUCZAXLN18UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0RkVF MkIzRDExM0ZDMDBBMzE2MkQ2MDYxNTJDMjk0MzAxRUEyQzQ5MxAcYXJzZW5AYWFy c2VuLm1lAAoJEFLClDAeosSTfu8BAOQ+NSD9FjNi3cUXnyja62wp2yEsbSMPa/Ek OCaKU39QAQDu/c9gpmPLZx41h1cWarypg+VnTQbvHCl43F0du4qaBw== =M+2N -----END PGP SIGNATURE----- --=-=-=--