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: Fri, 22 Dec 2023 20:09:19 +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="12708"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, 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 Fri Dec 22 21:10:22 2023 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 1rGlqf-00035J-Pf for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 Dec 2023 21:10:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGlqK-0008TJ-GA; Fri, 22 Dec 2023 15:10: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 1rGlqI-0008Sq-2e for bug-gnu-emacs@gnu.org; Fri, 22 Dec 2023 15:09:58 -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 1rGlqH-0005xH-QE for bug-gnu-emacs@gnu.org; Fri, 22 Dec 2023 15:09:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rGlqM-0008Ih-1c for bug-gnu-emacs@gnu.org; Fri, 22 Dec 2023 15:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Dec 2023 20:10:02 +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.170327577731872 (code B ref 67483); Fri, 22 Dec 2023 20:10:02 +0000 Original-Received: (at 67483) by debbugs.gnu.org; 22 Dec 2023 20:09:37 +0000 Original-Received: from localhost ([127.0.0.1]:47921 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGlpx-0008I0-4I for submit@debbugs.gnu.org; Fri, 22 Dec 2023 15:09:37 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:25554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGlpr-0008Hi-P9 for 67483@debbugs.gnu.org; Fri, 22 Dec 2023 15:09:35 -0500 Original-Received: (qmail 49226 invoked by uid 3782); 22 Dec 2023 21:09:20 +0100 Original-Received: from acm.muc.de (p4fe15ca9.dip0.t-ipconnect.de [79.225.92.169]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 22 Dec 2023 21:09:19 +0100 Original-Received: (qmail 20936 invoked by uid 1000); 22 Dec 2023 20:09:19 -0000 Content-Disposition: inline In-Reply-To: <58AFDAEE-7E28-4896-B0C1-D5212C9ECB31@gmail.com> 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:276690 Archived-At: 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).