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#67483: Wrong warning position given by the byte compiler for a malformed function Date: Sat, 13 Jan 2024 14:05:54 +0000 Message-ID: References: <59773797-CC64-4352-9528-4E7593DD3C1F@gmail.com> <522B6349-614D-48AD-963D-76CF59A30497@gmail.com> <58AFDAEE-7E28-4896-B0C1-D5212C9ECB31@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38642"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , 67483@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 13 15:07:14 2024 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 1rOefJ-0009rf-UM for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Jan 2024 15:07:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rOefB-0006UQ-Tm; Sat, 13 Jan 2024 09:07:06 -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 1rOefA-0006MQ-2S for bug-gnu-emacs@gnu.org; Sat, 13 Jan 2024 09:07:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rOef9-000594-Nc for bug-gnu-emacs@gnu.org; Sat, 13 Jan 2024 09:07:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rOef7-0005FS-Od for bug-gnu-emacs@gnu.org; Sat, 13 Jan 2024 09:07:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Jan 2024 14:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67483 X-GNU-PR-Package: emacs Original-Received: via spool by 67483-submit@debbugs.gnu.org id=B67483.170515476320110 (code B ref 67483); Sat, 13 Jan 2024 14:07:01 +0000 Original-Received: (at 67483) by debbugs.gnu.org; 13 Jan 2024 14:06:03 +0000 Original-Received: from localhost ([127.0.0.1]:38785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOeeB-0005EH-4R for submit@debbugs.gnu.org; Sat, 13 Jan 2024 09:06:03 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:35923) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOee8-0005Dj-J6 for 67483@debbugs.gnu.org; Sat, 13 Jan 2024 09:06:01 -0500 Original-Received: (qmail 31105 invoked by uid 3782); 13 Jan 2024 15:05:55 +0100 Original-Received: from acm.muc.de (p4fe15740.dip0.t-ipconnect.de [79.225.87.64]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 13 Jan 2024 15:05:55 +0100 Original-Received: (qmail 29200 invoked by uid 1000); 13 Jan 2024 14:05:54 -0000 Content-Disposition: inline In-Reply-To: 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:278128 Archived-At: Hello, Mattias. Ping? On Fri, Dec 22, 2023 at 20:09:19 +0000, Alan Mackenzie wrote: > Hello, Mattias. > On Fri, Dec 22, 2023 at 14:12:46 +0100, Mattias Engdegård wrote: > > 22 dec. 2023 kl. 12.24 skrev Alan Mackenzie : > > > What's the process of converting to a closure got to do with > > > maintaining the stack of forms for error processing? > > Not much, but cconv has evolved to one major part of the compiler > > front-end (the other being macroexp-all) and isn't restricted to just > > closure conversion. > No, it hasn't "evolved", somebody has changed it. Why? A file, just > like a function, should have a particular purpose, and degrading a > specific purpose file to being a general place to put random things is a > BAD THING. What's going on, here? > > In fact, it's now used for dynbound code as well. > Does this file, in fact, still have a purpose? > > In particular it's a natural place for various front-end checks and > > transforms, so don't let the place and name distract you. There are > > plans to refactor it later on for other reasons. > > > Whoops! There was no patch. > > Attached it now, sorry. > > > You've put the new macro into macroexp.el. This file is purely about > > > macro handling. > > Actually macroexp.el does more than that, and in any case the file > > isn't very important; the macro ended up there to be next to > > byte-compile-form-stack. Nor is the name; it can be changed at any > > time. > > However, it probably needs to be in that file for bootstrap reasons. > byte-compile-form-stack is in there for bootstrap reasons. But it's > logically part of bytecomp.el, hence the name. > > > And is the "--" in the name appropriate, given that the macro is used > > > by several files? I'm not sure about that rule. > > The double-dash just means that users shouldn't get any funny ideas. > > (The converse isn't true: a name without double-dash isn't > > automatically fair game.) > > > Also, byte-compile-form-stack gets bound in cconv-closure-convert. > > > Why? > > It's just a backstop. Not strictly needed. It's probably fine to remove > > it if you are worried, but then again there shouldn't be any (non-bug) > > error signalling here. I'll have a look. > How can you be so casual about this? It's critically important to > byte-compile-form-stack's correct working that it does NOT get bound. > Surely you understand this? > Also, you ignored and snipped the most important point in my last post, > namely this: > > > But cconv-closure-convert doesn't get called recursively. So it > > > would seem the wrong place to be maintaining byte-compile-form-stack. > > > What's needed is a place where that stack grows steadily as the > > > source code is recursed into, to ensure there will be a correct > > > position on it in the event of an warning/error. > Please attend to this point now. Does byte-compile-form-stack get pushed > onto at each recursive descent into the source code? This is important. -- Alan Mackenzie (Nuremberg, Germany).