all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: "Mattias Engdegård" <mattias.engdegard@gmail.com>
Cc: acm@muc.de, Stefan Monnier <monnier@iro.umontreal.ca>,
	67483@debbugs.gnu.org
Subject: bug#67483: Wrong warning position given by the byte compiler for a malformed function
Date: Fri, 22 Dec 2023 20:09:19 +0000	[thread overview]
Message-ID: <ZYXs77UipvEWewo8@ACM> (raw)
In-Reply-To: <58AFDAEE-7E28-4896-B0C1-D5212C9ECB31@gmail.com>

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 <acm@muc.de>:

> > 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).





  reply	other threads:[~2023-12-22 20:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27 12:40 bug#67483: Wrong warning position given by the byte compiler for a malformed function Alan Mackenzie
2023-11-27 13:14 ` Eli Zaretskii
2023-11-27 13:20   ` Alan Mackenzie
2023-11-27 13:50     ` Eli Zaretskii
2023-11-27 14:01       ` Alan Mackenzie
2023-11-27 15:09         ` Eli Zaretskii
2023-11-27 15:47           ` Alan Mackenzie
2023-11-30 10:37 ` Mattias Engdegård
2023-12-04 18:19   ` Alan Mackenzie
2023-12-19 18:23     ` Mattias Engdegård
2023-12-21 12:22     ` Mattias Engdegård
2023-12-22 11:24       ` Alan Mackenzie
2023-12-22 13:12         ` Mattias Engdegård
2023-12-22 20:09           ` Alan Mackenzie [this message]
2024-01-13 14:05             ` Alan Mackenzie
2023-12-04 16:44 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found] ` <handler.67483.B.170108887925620.ack@debbugs.gnu.org>
2023-12-08 20:19   ` bug#67483: Acknowledgement (Wrong warning position given by the byte compiler for a malformed function) Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZYXs77UipvEWewo8@ACM \
    --to=acm@muc.de \
    --cc=67483@debbugs.gnu.org \
    --cc=mattias.engdegard@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.