From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Merging feature/android Date: Mon, 06 Mar 2023 21:10:46 +0800 Message-ID: <87edq2qb3d.fsf@yahoo.com> References: <87edq7ztks.fsf.ref@yahoo.com> <83356mcbxw.fsf@gnu.org> <87pm9qvu9w.fsf@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> <867cvuz1hp.fsf@aarsen.me> <87r0u2qi7w.fsf@yahoo.com> <86mt4qxhf7.fsf@aarsen.me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17244"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Paul Eggert , Eli Zaretskii , emacs-devel@gnu.org To: Arsen =?utf-8?Q?Arsenovi=C4=87?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 06 14:11:29 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 1pZAch-0004HV-QC for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Mar 2023 14:11:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZAcG-0003TT-Si; Mon, 06 Mar 2023 08:11:00 -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 1pZAcF-0003T6-Vl for emacs-devel@gnu.org; Mon, 06 Mar 2023 08:10:59 -0500 Original-Received: from sonic314-20.consmr.mail.ne1.yahoo.com ([66.163.189.146]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZAcD-000358-Lb for emacs-devel@gnu.org; Mon, 06 Mar 2023 08:10:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678108253; bh=F+g7i2c77TC998DVVD3M0blJuwCjcRPY7efWoBGJoT4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=fS9gl5mG13j8/wiqiMueLZdfU7HlgMd13B4ZQevvL8N7TpPm3bpQ0t+tcGhP5WZNEc+6uvgE8RBWuENgWpkibTwjWG8NPmKpMW/jXrEUH6RlP+7zHjM6Q2jaUnKiWLF5yGUWViA/tXciojSZPDpl1G9ltQ1Pl1ksgOqDLYZ2cb0ryr+AuT/4V3EP1eL37KWX1GU6e01TbRQk6ECEK4IVOpKQAy15vrM+t+j4IIu2uvftm2/lTmxlMZjJgupH3pHrzaxgiU4XDlJqG4gHKacmQlSsvI6z03QVkd39jUZICC2yJfRHC8C4+Ys7t4I1Ks1mQPH3xmeZYyzRUFL6Yjn4jQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678108253; bh=fTWl3KRMp1Pxo0Nsy3rWVuzXbjk9gw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ARqUiUhI5h.LvfVbkA3hvrLwwELKSKy0y0FZlQu1I4fSfiEi0Vk53nE229O_Urzh58GkUbUa_epa Z2DSLYdk7QEEJSge1k0W1rkToShkZeYpEcBL1GKYBvdzO9ArZa29uaZSuTC09Kj_rzcaQSb1E386 b3_T.jn5bOc1PXCuADWrA6ZtXPJ5yjKLu9uR4vyph4 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Mon, 6 Mar 2023 13:10:53 +0000 Original-Received: by hermes--production-bf1-777648578f-7gmg8 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 2a14ce3ab98e94f1dcfe489d46408fa2; Mon, 06 Mar 2023 13:10:50 +0000 (UTC) In-Reply-To: <86mt4qxhf7.fsf@aarsen.me> ("Arsen =?utf-8?Q?Arsenovi=C4=87?= =?utf-8?Q?=22's?= message of "Mon, 06 Mar 2023 11:56:09 +0100") X-Mailer: WebService/1.1.21221 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.189.146; envelope-from=luangruo@yahoo.com; helo=sonic314-20.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:304039 Archived-At: Arsen Arsenovi=C4=87 writes: > Po Lu writes: > >> Arsen Arsenovi=C4=87 writes: >> >>> 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. >> >> GNU C cleanups only work when compiling with -fexceptions. > > This is not the case. They work under all conditions, and are used to > great effect in many C codebases. As an example, the following: > > int > f (void (*foo) (void)) > { > __attribute__ ((cleanup (test))) int* n =3D g (); > foo (); > } > > ... generates: > > f: > pushq %rbx > xorl %eax, %eax > movq %rdi, %rbx > subq $16, %rsp > call g > movq %rax, 8(%rsp) > call *%rbx > leaq 8(%rsp), %rdi > call test /* cleanup */ > addq $16, %rsp > popq %rbx > ret > > ... with -O3 -fno-exceptions. The latter is the default for C, but I > wanted to be explicit anyway. I meant that they only work to handle C++ exceptions when you compile with -fexceptions, so it is rather pointless to use it as we do now. Without -fexceptions, that code is no different from: f (foo) int (*foo) (); { int *n; n =3D g (); foo (); test (fn); } > It is likely as widely available as cleanup attributes. Certainly as > widely as any supported (or many unsupported) versions of GCC are. > > I won't argue on the merits of the language, as that usually doesn't go > anywhere, and the cleanup attribute seems like an accepted solution > anyway. Note that it's no coincidence that it is being adopted by some > GNU projects. The GNU Coding Standards recommend against relying on GNU C extensions in Emacs. > I agree that it isn't necessary. I was just answering the question of > what '-fexceptions' would do as someone with the know-how, because it > was brought up. OK, then let's not waste any more time here. Thanks.