From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#21466: [PATCH] Avoid defining (temporarily) vars and functions Date: Sat, 26 Mar 2022 19:51:35 +0000 Message-ID: References: <87eeeestgu.fsf@gnus.org> <87y2105swg.fsf@gnus.org> <877d8gd5k3.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27505"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , 21466@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 26 20:52:18 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1nYCSP-0006t9-B1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Mar 2022 20:52:17 +0100 Original-Received: from localhost ([::1]:43866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nYCSN-0006M7-V9 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Mar 2022 15:52:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYCSI-0006Lz-7Z for bug-gnu-emacs@gnu.org; Sat, 26 Mar 2022 15:52:10 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60821) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nYCS9-0002Kg-T2; Sat, 26 Mar 2022 15:52:09 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nYCS9-0002pa-Oe; Sat, 26 Mar 2022 15:52:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sat, 26 Mar 2022 19:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21466 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: patch Original-Received: via spool by 21466-submit@debbugs.gnu.org id=B21466.164832430610860 (code B ref 21466); Sat, 26 Mar 2022 19:52:01 +0000 Original-Received: (at 21466) by debbugs.gnu.org; 26 Mar 2022 19:51:46 +0000 Original-Received: from localhost ([127.0.0.1]:54718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYCRu-0002p5-DP for submit@debbugs.gnu.org; Sat, 26 Mar 2022 15:51:46 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:27813 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1nYCRr-0002oq-Rk for 21466@debbugs.gnu.org; Sat, 26 Mar 2022 15:51:44 -0400 Original-Received: (qmail 26377 invoked by uid 3782); 26 Mar 2022 19:51:36 -0000 Original-Received: from acm.muc.de (p2e5d5498.dip0.t-ipconnect.de [46.93.84.152]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 26 Mar 2022 20:51:36 +0100 Original-Received: (qmail 9046 invoked by uid 1000); 26 Mar 2022 19:51:35 -0000 Content-Disposition: inline In-Reply-To: <877d8gd5k3.fsf@gnus.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:228983 Archived-At: Hello, Lars. On Sat, Mar 26, 2022 at 17:47:24 +0100, Lars Ingebrigtsen wrote: > Alan Mackenzie writes: > > These explain the "free variable" warnings for the variables and the > > "defined multiple times" warnings for the functions. > > To sort out this bug properly, we really need Lisp functions equivalent > > to C's extern. (defvar foo) and (declare-function 'foo nil) currently > > don't fill this need. > I had a brief look at a couple of the warnings (after the patch), and it > looks like the warnings could be resolved by just removing the > cc-bytecomp-deffun (and rearranging the code order). The whole patch was predicated on: >>>> It might have made sense back in the days when the >>>> byte-compiler did not offer built-in ways to silence those >>>> warnings, but nowadays we can do better. I'm not convinced that what the byte compiler currently offers is "better", if that involves having to rearrange things in a source file. And even then, that would only resolve two of the ~15 warning messages. By contrast, leaving things alone is not causing any trouble, and seems unlikely to cause trouble in the near future. There is currently no clean way of declaring a symbol's variable or function cell as bound for the byte compiler. Perhaps there should be. > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no -- Alan Mackenzie (Nuremberg, Germany).