GNU bug report logs - #67483
Wrong warning position given by the byte compiler for a malformed function

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Alan Mackenzie <acm@HIDDEN>; dated Mon, 27 Nov 2023 12:42:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 67483 <at> debbugs.gnu.org:


Received: (at 67483) by debbugs.gnu.org; 13 Jan 2024 14:06:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 13 09:06:03 2024
Received: from localhost ([127.0.0.1]:38785 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rOeeB-0005EH-4R
	for submit <at> debbugs.gnu.org; Sat, 13 Jan 2024 09:06:03 -0500
Received: from mail.muc.de ([193.149.48.3]:35923)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1rOee8-0005Dj-J6
 for 67483 <at> debbugs.gnu.org; Sat, 13 Jan 2024 09:06:01 -0500
Received: (qmail 31105 invoked by uid 3782); 13 Jan 2024 15:05:55 +0100
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
Received: (qmail 29200 invoked by uid 1000); 13 Jan 2024 14:05:54 -0000
Date: Sat, 13 Jan 2024 14:05:54 +0000
To: Mattias =?iso-8859-1?Q?Engdeg=E5rd?= <mattias.engdegard@HIDDEN>
Subject: Re: bug#67483: Wrong warning position given by the byte compiler for
 a malformed function
Message-ID: <ZaKYwmIKno0XivGC@ACM>
References: <59773797-CC64-4352-9528-4E7593DD3C1F@HIDDEN>
 <ZW4YKaewsza_bx4s@ACM>
 <522B6349-614D-48AD-963D-76CF59A30497@HIDDEN>
 <ZYVx6kOxsH6uw_AL@ACM>
 <58AFDAEE-7E28-4896-B0C1-D5212C9ECB31@HIDDEN>
 <ZYXs77UipvEWewo8@ACM>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ZYXs77UipvEWewo8@ACM>
X-Submission-Agent: TMDA/1.3.x (Ph3nix)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67483
Cc: Stefan Monnier <monnier@HIDDEN>, 67483 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

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 <acm@HIDDEN>:

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67483; Package emacs. Full text available.

Message received at 67483 <at> debbugs.gnu.org:


Received: (at 67483) by debbugs.gnu.org; 22 Dec 2023 20:09:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 22 15:09:37 2023
Received: from localhost ([127.0.0.1]:47921 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rGlpx-0008I0-4I
	for submit <at> debbugs.gnu.org; Fri, 22 Dec 2023 15:09:37 -0500
Received: from mail.muc.de ([193.149.48.3]:25554)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1rGlpr-0008Hi-P9
 for 67483 <at> debbugs.gnu.org; Fri, 22 Dec 2023 15:09:35 -0500
Received: (qmail 49226 invoked by uid 3782); 22 Dec 2023 21:09:20 +0100
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
Received: (qmail 20936 invoked by uid 1000); 22 Dec 2023 20:09:19 -0000
Date: Fri, 22 Dec 2023 20:09:19 +0000
To: Mattias =?iso-8859-1?Q?Engdeg=E5rd?= <mattias.engdegard@HIDDEN>
Subject: Re: bug#67483: Wrong warning position given by the byte compiler for
 a malformed function
Message-ID: <ZYXs77UipvEWewo8@ACM>
References: <59773797-CC64-4352-9528-4E7593DD3C1F@HIDDEN>
 <ZW4YKaewsza_bx4s@ACM>
 <522B6349-614D-48AD-963D-76CF59A30497@HIDDEN>
 <ZYVx6kOxsH6uw_AL@ACM>
 <58AFDAEE-7E28-4896-B0C1-D5212C9ECB31@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <58AFDAEE-7E28-4896-B0C1-D5212C9ECB31@HIDDEN>
X-Submission-Agent: TMDA/1.3.x (Ph3nix)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67483
Cc: acm@HIDDEN, Stefan Monnier <monnier@HIDDEN>,
 67483 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

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@HIDDEN>:

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67483; Package emacs. Full text available.

Message received at 67483 <at> debbugs.gnu.org:


Received: (at 67483) by debbugs.gnu.org; 22 Dec 2023 13:13:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 22 08:13:05 2023
Received: from localhost ([127.0.0.1]:46212 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rGfKq-000818-Kc
	for submit <at> debbugs.gnu.org; Fri, 22 Dec 2023 08:13:04 -0500
Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]:44451)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@HIDDEN>) id 1rGfKl-00080a-9q
 for 67483 <at> debbugs.gnu.org; Fri, 22 Dec 2023 08:13:03 -0500
Received: by mail-lj1-x22c.google.com with SMTP id
 38308e7fff4ca-2ccae380df2so3842051fa.1
 for <67483 <at> debbugs.gnu.org>; Fri, 22 Dec 2023 05:12:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1703250768; x=1703855568; darn=debbugs.gnu.org;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:sender:from:to:cc:subject:date:message-id:reply-to;
 bh=wGnBdUJBZ0VK+u0ijPnZsVNF1kECkKAbvCt/jywFVKw=;
 b=XD/hbu+HTo7ZNjlXqaBn3iIvrZ5LWoX5gq9p28qqtF7S8rbx5ZTrGqe0puMF1xAnaX
 TcL6xjJKMjxsBW9bONVCJnVjnNt770Hh7cnFV1olaChGd7GqMsnU8ogTMp8yFQ+NMtDc
 h/nsyq+w4WA/oc504jyBJ2wOe8qDU0qOuRCU+3p/pvqeAZj4SliP5t16hKh/g1IN2WBa
 wI4dViFW5YWz8nynExW5RbeLO5WYbg/wZ2AKEY5Tq3yrL4sMd2x2hNAG5wv1jGApPUii
 rH7t+fO/B21rlKYw3zGI/MnbAjwhhzRlVLIpoW9MKHH5htROvRjYo0hxK0dSsc53NY+J
 MClg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1703250768; x=1703855568;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=wGnBdUJBZ0VK+u0ijPnZsVNF1kECkKAbvCt/jywFVKw=;
 b=cN/1o+4ktG+l+bc80cX632hl56szNH4DJC6drZy26lnK/frlUPCd29Q41mnL4WfEHQ
 pgMiWlm60RFmt1yhw/nD+gsXDomZgngQp/W12os6ReAzEpaDHb8T5AgQFKRlUdjUQXGp
 Om8ys2dRSMZXO2SfI7jz/7Gp0UoTdEmalxpiBgpvxkgcswH+T+GyNj7oPapHAeUHLgHO
 YsAa0OcOBfmps5AAE1Rfrm7KR6b92gkXWYWa0n+Y9SEZzRHOzB51jM0npo9BxUu5pGsc
 XXuX50mluENCS0w1rbl03BADxF8q+diDS1zduFb0cgJ9rJmomPS1zjs1uMlwQMGBm75t
 YyEg==
X-Gm-Message-State: AOJu0Yy6zpxra7B/Fu4sx76z4RPRp8afHq4o98s/PY8Xhd/L7tVOqH5G
 bB4PB4oaq+E9GF0O9YsOWy/5N5FAaJo=
X-Google-Smtp-Source: AGHT+IGxI2Y4B1IVZmUwyH3adrnSwi+sTwV9uCRxyGAwD0dTHUpVku8N1p59b4WH1U/GoVcYOE6GPg==
X-Received: by 2002:a2e:2405:0:b0:2cc:73cf:82e9 with SMTP id
 k5-20020a2e2405000000b002cc73cf82e9mr577272ljk.48.1703250768064; 
 Fri, 22 Dec 2023 05:12:48 -0800 (PST)
Received: from smtpclient.apple (c80-217-1-132.bredband.tele2.se.
 [80.217.1.132]) by smtp.gmail.com with ESMTPSA id
 a11-20020a2ebe8b000000b002ca0cb6f476sm580489ljr.60.2023.12.22.05.12.47
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 22 Dec 2023 05:12:47 -0800 (PST)
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
Message-Id: <58AFDAEE-7E28-4896-B0C1-D5212C9ECB31@HIDDEN>
Content-Type: multipart/mixed;
 boundary="Apple-Mail=_A8785F6F-E315-43E2-A05E-13A5E0487CD1"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Subject: Re: bug#67483: Wrong warning position given by the byte compiler for
 a malformed function
Date: Fri, 22 Dec 2023 14:12:46 +0100
In-Reply-To: <ZYVx6kOxsH6uw_AL@ACM>
To: Alan Mackenzie <acm@HIDDEN>
References: <59773797-CC64-4352-9528-4E7593DD3C1F@HIDDEN>
 <ZW4YKaewsza_bx4s@ACM> <522B6349-614D-48AD-963D-76CF59A30497@HIDDEN>
 <ZYVx6kOxsH6uw_AL@ACM>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67483
Cc: Stefan Monnier <monnier@HIDDEN>, 67483 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--Apple-Mail=_A8785F6F-E315-43E2-A05E-13A5E0487CD1
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

22 dec. 2023 kl. 12.24 skrev Alan Mackenzie <acm@HIDDEN>:

> 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. In fact, it's now used for dynbound code as well.

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.

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


--Apple-Mail=_A8785F6F-E315-43E2-A05E-13A5E0487CD1
Content-Disposition: attachment;
	filename=0001-Capture-byte-compile-form-stack-in-delayed-warnings-.patch
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="0001-Capture-byte-compile-form-stack-in-delayed-warnings-.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=200a4222090ee3b6690b3097a06dacd23546c7350b=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20=
<mattiase@HIDDEN>=0ADate:=20Wed,=2020=20Dec=202023=2011:11:56=20+0100=0A=
Subject:=20[PATCH]=20Capture=20byte-compile-form-stack=20in=20delayed=20=
warnings=0A=20(bug#67483)=0A=0A*=20lisp/emacs-lisp/macroexp.el=20=
(macroexp--warn-wrap):=0AWhen=20recording=20a=20delayed=20warning,=20=
capture=20the=20current=20value=20of=0A`byte-compile-form-stack`=20=
because=20it=20is=20more=20likely=20to=20contain=20a=0Arelevant=20source=20=
location=20than=20whatever=20we=20are=20traversing=20in=20codegen.=0A---=0A=
=20lisp/emacs-lisp/macroexp.el=20|=2014=20++++++++------=0A=201=20file=20=
changed,=208=20insertions(+),=206=20deletions(-)=0A=0Adiff=20--git=20=
a/lisp/emacs-lisp/macroexp.el=20b/lisp/emacs-lisp/macroexp.el=0Aindex=20=
2a646be9725..8cf6ad7256d=20100644=0A---=20a/lisp/emacs-lisp/macroexp.el=0A=
+++=20b/lisp/emacs-lisp/macroexp.el=0A@@=20-168,12=20+168,14=20@@=20=
macroexp-file-name=0A=20(defvar=20macroexp--warned=20(make-hash-table=20=
:test=20#'equal=20:weakness=20'key))=0A=20=0A=20(defun=20=
macroexp--warn-wrap=20(arg=20msg=20form=20category)=0A-=20=20(let=20=
((when-compiled=0A-=09=20(lambda=20()=0A-=20=20=20=20=20=20=20=20=20=20=20=
(when=20(if=20(consp=20category)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20(apply=20#'byte-compile-warning-enabled-p=20=
category)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
(byte-compile-warning-enabled-p=20category))=0A-=20=20=20=20=20=20=20=20=20=
=20=20=20=20(byte-compile-warn-x=20arg=20"%s"=20msg)))))=0A+=20=20(let*=20=
((stack=20byte-compile-form-stack)=0A+=20=20=20=20=20=20=20=20=20=
(when-compiled=0A+=09=20=20(lambda=20()=0A+=20=20=20=20=20=20=20=20=20=20=
=20=20(when=20(if=20(consp=20category)=0A+=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20(apply=20=
#'byte-compile-warning-enabled-p=20category)=0A+=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20(byte-compile-warning-enabled-p=20=
category))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20(let=20=
((byte-compile-form-stack=20stack))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20(byte-compile-warn-x=20arg=20"%s"=20msg))))))=0A=20=20=20=20=20=
`(progn=0A=20=20=20=20=20=20=20=20(macroexp--funcall-if-compiled=20=
',when-compiled)=0A=20=20=20=20=20=20=20=20,form)))=0A--=20=0A2.32.0=20=
(Apple=20Git-132)=0A=0A=

--Apple-Mail=_A8785F6F-E315-43E2-A05E-13A5E0487CD1--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67483; Package emacs. Full text available.

Message received at 67483 <at> debbugs.gnu.org:


Received: (at 67483) by debbugs.gnu.org; 22 Dec 2023 11:24:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 22 06:24:51 2023
Received: from localhost ([127.0.0.1]:46118 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rGde6-0003aJ-Lc
	for submit <at> debbugs.gnu.org; Fri, 22 Dec 2023 06:24:51 -0500
Received: from mail.muc.de ([193.149.48.3]:10105)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1rGddu-0003Zm-V0
 for 67483 <at> debbugs.gnu.org; Fri, 22 Dec 2023 06:24:49 -0500
Received: (qmail 36047 invoked by uid 3782); 22 Dec 2023 12:24:27 +0100
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 12:24:27 +0100
Received: (qmail 14643 invoked by uid 1000); 22 Dec 2023 11:24:26 -0000
Date: Fri, 22 Dec 2023 11:24:26 +0000
To: Mattias =?iso-8859-1?Q?Engdeg=E5rd?= <mattias.engdegard@HIDDEN>
Subject: Re: bug#67483: Wrong warning position given by the byte compiler for
 a malformed function
Message-ID: <ZYVx6kOxsH6uw_AL@ACM>
References: <59773797-CC64-4352-9528-4E7593DD3C1F@HIDDEN>
 <ZW4YKaewsza_bx4s@ACM>
 <522B6349-614D-48AD-963D-76CF59A30497@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <522B6349-614D-48AD-963D-76CF59A30497@HIDDEN>
X-Submission-Agent: TMDA/1.3.x (Ph3nix)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67483
Cc: acm@HIDDEN, Stefan Monnier <monnier@HIDDEN>,
 67483 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Mattias.

On Thu, Dec 21, 2023 at 13:22:17 +0100, Mattias Engdegård wrote:
> 4 dec. 2023 kl. 19.19 skrev Alan Mackenzie <acm@HIDDEN>:

> > You've undone the bug fix, and the bug is there again.

> Oops. An honest mistake, very sorry about that.

Ah, these things happen!  No great problem.

> On the other hand, these blunders often turn out to be beneficial in
> the end because they force us to take a better look at the problem.

> I ended up maintaining `byte-compile-form-stack` in `cconv-convert`
> which isn't free but a lot better than doing it in the optimiser. We
> emit a fair amount of warnings in cconv so this should be useful for
> other reasons as well.

I don't understand this.  What's the process of converting to a closure
got to do with maintaining the stack of forms for error processing?
cconv shouldn't even be involved at all for dynamic binding - it would
seem to me that the only reason for calling cconv in this case is now to
get the error handling.  This doesn't seem good.  What am I missing?

> The warning was also reverted from delayed to immediate, which makes
> sense in this case (since it's essentially a syntax error) and in fact
> it wouldn't work otherwise because delayed warnings implicitly use the
> byte-compile-form-stack we have when traversing the post-optimisation
> tree in codegen.

This seems indeed a good thing.  I've never understood the delayed
warning mechanism.

> I'm inclined to do something about this last problem for good measure
> (see attached patch).

Whoops!  There was no patch.

> Most of the time the byte-compile-form-stack doesn't matter much
> because the warning argument contains a symbol with position, but when
> it does, the stack state in codegen when the warning is emitted is
> likely to be less useful than when the warning was registered in the
> front-end. Haven't made up my mind about this yet.

> > We do indeed, but here binding the variable simply doesn't work.  Parts
> > of the compiler, when they encounter errors, signal an error which gets
> > caught by a condition-case somewhere.

> Yes, so I noticed. This is rubbish of course; we should do something
> about it. We have some options.  Meanwhile I made a macro to
> encapsulate the ugly push-pop logic in one place.

You've put the new macro into macroexp.el.  This file is purely about
macro handling.  The new macro has nothing to do with this, it is part
of the compiler.  Surely it should be
byte-compile-with-extended-form-stack.  And is the "--" in the name
appropriate, given that the macro is used by several files?  I'm not
sure about that rule.

Also, byte-compile-form-stack gets bound in cconv-closure-convert.  Why?
It seems unneeded, and in the event of an error being caught by a
condition-case will undo all the good work that came from the tedious
discipline of using push and pop rather than binding.  

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.

I don't think this bug is properly fixed, yet.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67483; Package emacs. Full text available.

Message received at 67483 <at> debbugs.gnu.org:


Received: (at 67483) by debbugs.gnu.org; 21 Dec 2023 12:22:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 21 07:22:35 2023
Received: from localhost ([127.0.0.1]:42591 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rGI4Q-0005KV-Su
	for submit <at> debbugs.gnu.org; Thu, 21 Dec 2023 07:22:35 -0500
Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:50655)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@HIDDEN>) id 1rGI4K-0005KD-Ty
 for 67483 <at> debbugs.gnu.org; Thu, 21 Dec 2023 07:22:33 -0500
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-50e281b149aso899474e87.1
 for <67483 <at> debbugs.gnu.org>; Thu, 21 Dec 2023 04:22:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1703161339; x=1703766139; darn=debbugs.gnu.org;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:sender:from:to:cc:subject:date:message-id:reply-to;
 bh=6sbZISITKjHUoLPotSrNniiZG4o5OBW7tAcCFDRLlGg=;
 b=B+yXUC8xMlU6RQ1JkhvZSP8gdkqFuKUpzdD8qOEyUay22q241uKDyoTbbmYts2vcrF
 oGDtSOjghBx+MKr9EHzszg+Y01g0WjK6OfV7uECuIRS///JImfyHEGe8PsKq8/fa5ZBA
 aeV8FmasdzoEjqjeDzbDDtsUxBAzqSk47af3YTHpw6SOaVdn+EIQkFMwD3EMpFTtivee
 vHi8iYMF7+E0jIOD+FdPO7g+Xzdwjx6NFrXQSSyRVmLrY+JUP3tXgsLEOjX5cNd4Rv6o
 NnVQnm9fsFvzMvET2yZSL2LMcvE1MfxfDl6zo1HmGAzirZqsEPap76V83SdW7Nuw71Kq
 6ubQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1703161339; x=1703766139;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=6sbZISITKjHUoLPotSrNniiZG4o5OBW7tAcCFDRLlGg=;
 b=CZa3dmsOZGHDWvcz4I9vwCmT9mpHTfVIGcV5xFkgdR1szMvzwICPkeIs98SWgjOx0M
 ivT3eC8gyDmx2zorq9zNZGeFEBiVn9KGNdl+jCawBDYsFA81r6gdpSXAjQ8rfscqx8Nr
 cynlION+iNv3eS2KgZO+Q8v6TP2T3yjtCp4aY0i86HpGL1sp0yyYHh/4SMwwn0ZYEwka
 UI6lghuaEluAEoHJntvfMChxcPSPEJHFuva4wOnGFnrdjmGa4ioiJ3/XUZ9lQxAPoAZ5
 e76Vq3v5ckiCG4/g2OJL63SjFO+Oer+atpzfNijSkj2iiwgdNZ1e/3LaKzYbjzgZHe6Z
 mzoA==
X-Gm-Message-State: AOJu0Yy5TTyx9mmvcuzJDcAxOBgTVFn39vaK/XUwZMqiSJEmrQ9MDewr
 9H+EPObdDZEtrHekcAYkHlI=
X-Google-Smtp-Source: AGHT+IGRchBPfxcYIybvfk7pp/5iw/GjFzAKOjQDLXuCCPv64JBpGNERA+CA4fXLbIDc51uLBXTZXQ==
X-Received: by 2002:ac2:58f1:0:b0:50e:2800:d87c with SMTP id
 v17-20020ac258f1000000b0050e2800d87cmr3931616lfo.98.1703161338519; 
 Thu, 21 Dec 2023 04:22:18 -0800 (PST)
Received: from smtpclient.apple (c80-217-1-132.bredband.tele2.se.
 [80.217.1.132]) by smtp.gmail.com with ESMTPSA id
 i12-20020a056512006c00b0050cf2182f13sm254341lfo.187.2023.12.21.04.22.17
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 21 Dec 2023 04:22:18 -0800 (PST)
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
Message-Id: <522B6349-614D-48AD-963D-76CF59A30497@HIDDEN>
Content-Type: multipart/mixed;
 boundary="Apple-Mail=_2B565CCF-B729-469E-BBE8-767A85FCC4DB"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Subject: Re: bug#67483: Wrong warning position given by the byte compiler for
 a malformed function
Date: Thu, 21 Dec 2023 13:22:17 +0100
In-Reply-To: <ZW4YKaewsza_bx4s@ACM>
To: Alan Mackenzie <acm@HIDDEN>
References: <59773797-CC64-4352-9528-4E7593DD3C1F@HIDDEN>
 <ZW4YKaewsza_bx4s@ACM>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67483
Cc: Stefan Monnier <monnier@HIDDEN>, 67483 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--Apple-Mail=_2B565CCF-B729-469E-BBE8-767A85FCC4DB
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

4 dec. 2023 kl. 19.19 skrev Alan Mackenzie <acm@HIDDEN>:

> You've undone the bug fix, and the bug is there again.

Oops. An honest mistake, very sorry about that.
On the other hand, these blunders often turn out to be beneficial in the =
end because they force us to take a better look at the problem.

I ended up maintaining `byte-compile-form-stack` in `cconv-convert` =
which isn't free but a lot better than doing it in the optimiser. We =
emit a fair amount of warnings in cconv so this should be useful for =
other reasons as well.

The warning was also reverted from delayed to immediate, which makes =
sense in this case (since it's essentially a syntax error) and in fact =
it wouldn't work otherwise because delayed warnings implicitly use the =
byte-compile-form-stack we have when traversing the post-optimisation =
tree in codegen.

I'm inclined to do something about this last problem for good measure =
(see attached patch). Most of the time the byte-compile-form-stack =
doesn't matter much because the warning argument contains a symbol with =
position, but when it does, the stack state in codegen when the warning =
is emitted is likely to be less useful than when the warning was =
registered in the front-end. Haven't made up my mind about this yet.

> We do indeed, but here binding the variable simply doesn't work.  =
Parts
> of the compiler, when they encounter errors, signal an error which =
gets
> caught by a condition-case somewhere.

Yes, so I noticed. This is rubbish of course; we should do something =
about it. We have some options.
Meanwhile I made a macro to encapsulate the ugly push-pop logic in one =
place.


--Apple-Mail=_2B565CCF-B729-469E-BBE8-767A85FCC4DB
Content-Disposition: attachment;
	filename=0001-Capture-byte-compile-form-stack-in-delayed-warnings-.patch
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="0001-Capture-byte-compile-form-stack-in-delayed-warnings-.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=200a4222090ee3b6690b3097a06dacd23546c7350b=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20=
<mattiase@HIDDEN>=0ADate:=20Wed,=2020=20Dec=202023=2011:11:56=20+0100=0A=
Subject:=20[PATCH]=20Capture=20byte-compile-form-stack=20in=20delayed=20=
warnings=0A=20(bug#67483)=0A=0A*=20lisp/emacs-lisp/macroexp.el=20=
(macroexp--warn-wrap):=0AWhen=20recording=20a=20delayed=20warning,=20=
capture=20the=20current=20value=20of=0A`byte-compile-form-stack`=20=
because=20it=20is=20more=20likely=20to=20contain=20a=0Arelevant=20source=20=
location=20than=20whatever=20we=20are=20traversing=20in=20codegen.=0A---=0A=
=20lisp/emacs-lisp/macroexp.el=20|=2014=20++++++++------=0A=201=20file=20=
changed,=208=20insertions(+),=206=20deletions(-)=0A=0Adiff=20--git=20=
a/lisp/emacs-lisp/macroexp.el=20b/lisp/emacs-lisp/macroexp.el=0Aindex=20=
2a646be9725..8cf6ad7256d=20100644=0A---=20a/lisp/emacs-lisp/macroexp.el=0A=
+++=20b/lisp/emacs-lisp/macroexp.el=0A@@=20-168,12=20+168,14=20@@=20=
macroexp-file-name=0A=20(defvar=20macroexp--warned=20(make-hash-table=20=
:test=20#'equal=20:weakness=20'key))=0A=20=0A=20(defun=20=
macroexp--warn-wrap=20(arg=20msg=20form=20category)=0A-=20=20(let=20=
((when-compiled=0A-=09=20(lambda=20()=0A-=20=20=20=20=20=20=20=20=20=20=20=
(when=20(if=20(consp=20category)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20(apply=20#'byte-compile-warning-enabled-p=20=
category)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
(byte-compile-warning-enabled-p=20category))=0A-=20=20=20=20=20=20=20=20=20=
=20=20=20=20(byte-compile-warn-x=20arg=20"%s"=20msg)))))=0A+=20=20(let*=20=
((stack=20byte-compile-form-stack)=0A+=20=20=20=20=20=20=20=20=20=
(when-compiled=0A+=09=20=20(lambda=20()=0A+=20=20=20=20=20=20=20=20=20=20=
=20=20(when=20(if=20(consp=20category)=0A+=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20(apply=20=
#'byte-compile-warning-enabled-p=20category)=0A+=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20(byte-compile-warning-enabled-p=20=
category))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20(let=20=
((byte-compile-form-stack=20stack))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20(byte-compile-warn-x=20arg=20"%s"=20msg))))))=0A=20=20=20=20=20=
`(progn=0A=20=20=20=20=20=20=20=20(macroexp--funcall-if-compiled=20=
',when-compiled)=0A=20=20=20=20=20=20=20=20,form)))=0A--=20=0A2.32.0=20=
(Apple=20Git-132)=0A=0A=

--Apple-Mail=_2B565CCF-B729-469E-BBE8-767A85FCC4DB--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67483; Package emacs. Full text available.

Message received at 67483 <at> debbugs.gnu.org:


Received: (at 67483) by debbugs.gnu.org; 19 Dec 2023 18:23:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 19 13:23:38 2023
Received: from localhost ([127.0.0.1]:37306 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rFekk-0005Kp-EW
	for submit <at> debbugs.gnu.org; Tue, 19 Dec 2023 13:23:38 -0500
Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]:52664)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@HIDDEN>) id 1rFekj-0005Kd-4R
 for 67483 <at> debbugs.gnu.org; Tue, 19 Dec 2023 13:23:37 -0500
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-50e2ce4fb22so4823948e87.1
 for <67483 <at> debbugs.gnu.org>; Tue, 19 Dec 2023 10:23:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1703010208; x=1703615008; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject
 :date:message-id:reply-to;
 bh=skDIbh9eYowbX/V/Ahw6vvwJZgDNyRtq9mwDeop8f64=;
 b=J4KYqPw/StFUnfFj/yZ7HCRjFWiGLJzo7cYD2XKByEN2ZFDZ2CY6tb7EDpY0IG8bYv
 x5HL6/AI+LHrgkjdgTSOxVsDuNnFShmH0NwQVrYoFofu2K3vXaknzzftjGl4kGuL2Gy2
 lF7/VvJxWE8mtnUhBq8sk12zN5TYYdcNTd9jnFtFsPQuLP74dkVd98z2TFzXyQoKB+OZ
 ekn/sTKFBV8oZzczpMP3HI7femcRAc3Gjq0P9MT2V1oPi2GvjcoCYYnDPBcAI6B5qmVL
 IJ1cPl+FC8FR4hgkBqkl30xPd8vAA+QxE1KpvYQ2E+qwtUk2POMuobekojA2T1F0SKC1
 V51g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1703010208; x=1703615008;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=skDIbh9eYowbX/V/Ahw6vvwJZgDNyRtq9mwDeop8f64=;
 b=dS3Agc1pnwqiFSFR9o/c4WX2R/uXt1r8t8nM+zos8+pJvONUwJlIYKy4mRlX0wfsf5
 JbBFZcbbt51hGIlGaIsEEGktpksz/f5GOuzPbhgRk3XxvSlaNrabEdqOmJ8nN28CfS6L
 U78d+1guP6GkaTyrOAhiEujbwLAN02g8D2qcwIE/iGK56X3qyyuCuK0/7+kZQFsoUSJO
 75k7dJ5LBySKyaYZXoknmzoHpCgMm4k44SLP7LcRgzajnZW+Xuu0Y3yUQRLd6VhTNfrm
 ULxBnYpCzVid7z3dCHWuAShQAm2QYtpdKM+uS1ATFC4PTTNqkHcNjNKREH8AxfCx4hsv
 IoRQ==
X-Gm-Message-State: AOJu0YwnnmexMnYEPIXSVtDjCkvwNPpKUD80qW+CbQ+R/Bv6AHrr27D+
 BWcCPj8CYxfauG6IUJtONfU=
X-Google-Smtp-Source: AGHT+IFClocLbiSaKPX9oizpQ8wsqkYaVkhHpQelfoZAcomJMM7l3eg9lgaxsVPEZn6KKKhvwScrPA==
X-Received: by 2002:a05:6512:1155:b0:50e:2f95:e5b4 with SMTP id
 m21-20020a056512115500b0050e2f95e5b4mr3625122lfg.96.1703010207887; 
 Tue, 19 Dec 2023 10:23:27 -0800 (PST)
Received: from smtpclient.apple (c80-217-1-132.bredband.tele2.se.
 [80.217.1.132]) by smtp.gmail.com with ESMTPSA id
 l6-20020a19c206000000b0050e3ca2eb56sm539047lfc.287.2023.12.19.10.23.27
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 19 Dec 2023 10:23:27 -0800 (PST)
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Subject: Re: bug#67483: Wrong warning position given by the byte compiler for
 a malformed function
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
In-Reply-To: <ZW4YKaewsza_bx4s@ACM>
Date: Tue, 19 Dec 2023 19:23:26 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <4CB7269E-820F-4406-842A-A88CDF23E38B@HIDDEN>
References: <59773797-CC64-4352-9528-4E7593DD3C1F@HIDDEN>
 <ZW4YKaewsza_bx4s@ACM>
To: Alan Mackenzie <acm@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67483
Cc: Stefan Monnier <monnier@HIDDEN>, 67483 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Sorry about the delay. I hope being able to take a new look at this bug =
shortly.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67483; Package emacs. Full text available.
Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control <at> debbugs.gnu.org. Full text available.

Message received at 67483 <at> debbugs.gnu.org:


Received: (at 67483) by debbugs.gnu.org; 8 Dec 2023 20:19:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 08 15:19:27 2023
Received: from localhost ([127.0.0.1]:46272 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rBhJm-00052J-N9
	for submit <at> debbugs.gnu.org; Fri, 08 Dec 2023 15:19:27 -0500
Received: from mail.muc.de ([193.149.48.3]:49591)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1rBhJi-00051b-V5
 for 67483 <at> debbugs.gnu.org; Fri, 08 Dec 2023 15:19:25 -0500
Received: (qmail 17435 invoked by uid 3782); 8 Dec 2023 21:19:02 +0100
Received: from acm.muc.de (p4fe15328.dip0.t-ipconnect.de [79.225.83.40])
 (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Fri, 08 Dec 2023 21:19:02 +0100
Received: (qmail 21003 invoked by uid 1000); 8 Dec 2023 20:19:01 -0000
Date: Fri, 8 Dec 2023 20:19:01 +0000
To: 67483 <at> debbugs.gnu.org, control <at> debbugs.gnu.org
Subject: Re: bug#67483: Acknowledgement (Wrong warning position given by the
 byte compiler for a malformed function)
Message-ID: <ZXN6Nb0lEod_jyWa@ACM>
References: <ZWSOUXQufCLSlXBi@ACM>
 <handler.67483.B.170108887925620.ack <at> debbugs.gnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <handler.67483.B.170108887925620.ack <at> debbugs.gnu.org>
X-Submission-Agent: TMDA/1.3.x (Ph3nix)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67483
Cc: acm@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

reopen 67483
quit

The fix to this bug was undone by the following commit:

commit 8525be6d5eca0c75008ec1dc799cae537156feea
Author: Mattias Engdegård <mattiase@HIDDEN>
Date:   Wed Nov 29 17:51:46 2023 +0100

    Move malformed-function warning from byte-opt to cconv (bug#67483)

    We shouldn't be warning inside the optimiser in the first place.

    * lisp/emacs-lisp/byte-opt.el (byte-optimize-form):
    Remove byte-compile-form-stack manipulation.
    (byte-optimize-form-code-walker): Move malformed function warning
    from here...
    * lisp/emacs-lisp/cconv.el: ...to here.

On Mon, Nov 27, 2023 at 12:42:02 +0000, GNU bug Tracking System wrote:
> Thank you for filing a new bug report with debbugs.gnu.org.

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67483; Package emacs. Full text available.

Message received at 67483 <at> debbugs.gnu.org:


Received: (at 67483) by debbugs.gnu.org; 4 Dec 2023 18:19:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 04 13:19:41 2023
Received: from localhost ([127.0.0.1]:35664 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rADXh-0006J9-76
	for submit <at> debbugs.gnu.org; Mon, 04 Dec 2023 13:19:41 -0500
Received: from mail.muc.de ([193.149.48.3]:17135)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1rADXf-0006Iv-Mi
 for 67483 <at> debbugs.gnu.org; Mon, 04 Dec 2023 13:19:40 -0500
Received: (qmail 3028 invoked by uid 3782); 4 Dec 2023 19:19:22 +0100
Received: from acm.muc.de (pd953aae0.dip0.t-ipconnect.de [217.83.170.224])
 (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Mon, 04 Dec 2023 19:19:21 +0100
Received: (qmail 22251 invoked by uid 1000); 4 Dec 2023 18:19:21 -0000
Date: Mon, 4 Dec 2023 18:19:21 +0000
To: Mattias =?iso-8859-1?Q?Engdeg=E5rd?= <mattias.engdegard@HIDDEN>
Subject: Re: bug#67483: Wrong warning position given by the byte compiler for
 a malformed function
Message-ID: <ZW4YKaewsza_bx4s@ACM>
References: <59773797-CC64-4352-9528-4E7593DD3C1F@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <59773797-CC64-4352-9528-4E7593DD3C1F@HIDDEN>
X-Submission-Agent: TMDA/1.3.x (Ph3nix)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67483
Cc: acm@HIDDEN, Stefan Monnier <monnier@HIDDEN>,
 67483 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Mattias.

On Thu, Nov 30, 2023 at 11:37:31 +0100, Mattias Engdegård wrote:
> >     Buffer bad-error-position.el:2:4: Warning: `foo' is a malformed function

> > ..  This position 2:4 is wrong; it is the position of the `let' symbol.
> > The correct position would be 3:6, the position of the `if' symbol.

> (Actually the correct position would be the position of the string
> literal but of course our location tracking system is too simplistic
> for that.)

Indeed.

> Thank you for bringing this to our attention. Now I only saw this from
> the reference in your commit message; would you CC me next time?
> (Stefan, too, unless he objects.)

OK.

> I'm modifying your work a bit because we're trying to remove warnings
> from the optimiser, not entrenching them there. The warning is now in
> cconv but perhaps it should be moved to macroexp-all, it's not very
> important.

Many people consider accurate diagnostics to be very important.

> I hope being able to reshape the front-end a bit later on.

Well, I can hardly say thank you, here.  You've undone the bug fix, and
the bug is there again.  Did you actually test it before commiting your
change?  What should I do, now?  Reopen the bug and ask you actually to
fix it?  Or put the fix back in again myself?

You may not like warning handling code in the optimiser, but unless you
can come up with something better, its presence there is essential to
getting good diagnostics.

> Also, we usually prefer let-binding dynamic variables to push-pop
> pairs.

We do indeed, but here binding the variable simply doesn't work.  Parts
of the compiler, when they encounter errors, signal an error which gets
caught by a condition-case somewhere.  This would unbind
byte-compile-form-stack before the warning handlers could get a chance
to use it.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67483; Package emacs. Full text available.

Message received at 67483 <at> debbugs.gnu.org:


Received: (at 67483) by debbugs.gnu.org; 4 Dec 2023 16:45:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 04 11:45:24 2023
Received: from localhost ([127.0.0.1]:35524 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rAC4S-0003lt-6H
	for submit <at> debbugs.gnu.org; Mon, 04 Dec 2023 11:45:24 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63894)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1rAC4P-0003lZ-2Z
 for 67483 <at> debbugs.gnu.org; Mon, 04 Dec 2023 11:45:22 -0500
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 898378080C;
 Mon,  4 Dec 2023 11:45:04 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1701708303;
 bh=GjfoesgXIx1XcYdciObV1GfxLkCMj3KeePee2kp5OKQ=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=a6Sd7RRFhF1HXAv9krQLfVPg0872umK6rOqkLF15JLutX51hVKBceDO7tCS0wzFhm
 pcIWqdCNAEitIXOCfkCsiYZxjdpI9kzIe6cRTG+c86w1QC2Wz1RJm09iRMmt+DW3uP
 2Nuhu9BLdiYVhNpIC+WhbTsQebtts7MtgV5C99wiF50kJr7wv8QXPAxYD1lMu1EYZs
 Fqph6iM6LjCdloFcBiw0h3hi++OWB11dVi+z00+g5OX+eWS/fze7nMAhMV2J6wHLXj
 T0IzZyZw0Z9uo1cMteQlBxsGcmWde/t2aQzFTGaqIJxJXrz92nluFNy30ETEXPuEgO
 lOVCLpIQoEc8w==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C89BD8054F;
 Mon,  4 Dec 2023 11:45:03 -0500 (EST)
Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id BC414120183;
 Mon,  4 Dec 2023 11:45:03 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: bug#67483: Wrong warning position given by the byte compiler
 for a malformed function
In-Reply-To: <ZWSOUXQufCLSlXBi@ACM> (Alan Mackenzie's message of "Mon, 27 Nov
 2023 12:40:49 +0000")
Message-ID: <jwvil5dncp8.fsf-monnier+emacs@HIDDEN>
References: <ZWSOUXQufCLSlXBi@ACM>
Date: Mon, 04 Dec 2023 11:44:44 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.137 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 67483
Cc: 67483 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>     (defun foo ()
>       (let ((bar 'bar))
>         (if ("foo")  ; Erroneous "function".
>             (baz))))))
>
> ..  Use M-x compile-defun to compile it.  This gives an error message:
>
>     Buffer bad-error-position.el:2:4: Warning: `foo' is a malformed function
>
> ..  This position 2:4 is wrong; it is the position of the `let' symbol.
> The correct position would be 3:6, the position of the `if' symbol.

Also the message should use `"foo"` rather than `foo` (IOW,
the `%s` should be a `%S`).  As a general rule of thumb, `%s` should be
used *only* when displaying the content of a string, and `%S` should be
used for most/all other cases (e.g. when displaying what we expect is
a symbol, like here).


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67483; Package emacs. Full text available.

Message received at 67483 <at> debbugs.gnu.org:


Received: (at 67483) by debbugs.gnu.org; 30 Nov 2023 10:37:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 30 05:37:48 2023
Received: from localhost ([127.0.0.1]:52399 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r8eQW-0003w9-Jn
	for submit <at> debbugs.gnu.org; Thu, 30 Nov 2023 05:37:48 -0500
Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]:58617)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@HIDDEN>) id 1r8eQV-0003vx-3F
 for 67483 <at> debbugs.gnu.org; Thu, 30 Nov 2023 05:37:47 -0500
Received: by mail-lj1-x231.google.com with SMTP id
 38308e7fff4ca-2c9b5e50c1fso10707841fa.0
 for <67483 <at> debbugs.gnu.org>; Thu, 30 Nov 2023 02:37:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1701340653; x=1701945453; darn=debbugs.gnu.org;
 h=to:cc:date:message-id:subject:mime-version
 :content-transfer-encoding:from:sender:from:to:cc:subject:date
 :message-id:reply-to;
 bh=LABrHb8oELinn8NusjGnTtaiH8a3RJANuhfofyAjzAo=;
 b=DBjtJYs9NgRTt0viR0aWqsCWVm+1+S5sZ0nZDyVZX6vOIf89A55Ekk4edYqlUe8e27
 R089TJY9cE4HDq9ffvKkn610mbxw+wfJhP4qH4R5cLiRKSefbvxC0giyP9SpXMFhmoWj
 hX4XMuZit/CAaMV1vm4jPBQG31zjboD576qzlojmepr5Xn4ipmye59LSFhdmA9bvXkwU
 o/ztFQGRkr9DpvO1ik72+mdXoN3oHjunoZHM2Jot4Daaql8ovHiE52kjRjIuxw6Azaem
 fQPJKGgagqpKTebgW2qqp5xf4h3nPwHbBxaBztTRPBPhUZ+FDclCqafibAOyHL907181
 UVZg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1701340653; x=1701945453;
 h=to:cc:date:message-id:subject:mime-version
 :content-transfer-encoding:from:sender:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=LABrHb8oELinn8NusjGnTtaiH8a3RJANuhfofyAjzAo=;
 b=GwQ9Rocs9qpOsx08bJDWRHxDeyEjmtvv0N1/8jMvgL1QDGqkYY1K1CmbNysY8e8VqG
 aPFajBLqoBkoXJ1wvkfvklGM/wvwnfSlYmwwxsRMo4TIo+oyCqqFbB4Rf6yi0qbCiNuP
 UJMSSlRqty66sF0Ni4tjvAWdx8KXHdBDO/iEwW6Ol3hJQs5wq23mhXmdawHfPL+aIP1h
 JWbkYmecbrvU/tcJYFqQgNLJwI0T6/xTITC7+Vlmpb8MlIJ0E0J1AAJy3YIBYOBNAMGF
 ZwpZ0sZsk75W6KdOCvhm4cCbRnyzoWJB9ojVAvEINznUQtSjvGbUxxIHdwucs80ywoZC
 kAuQ==
X-Gm-Message-State: AOJu0YzEaj+uzJqYAz4kOVn5F7LK1jeJVWIRdiSRPwhwqHb0jzNvHtJ/
 3dyg/pZC7keyuNSfP5iTaOc=
X-Google-Smtp-Source: AGHT+IEYUXFFkb8uVswS2soZpRhmHff7esKYFdxHNza8T0y4JhXJGVKVztl6vh42mDb3dPdQebluNg==
X-Received: by 2002:a2e:8012:0:b0:2c9:bdb0:c15e with SMTP id
 j18-20020a2e8012000000b002c9bdb0c15emr4026782ljg.3.1701340652833; 
 Thu, 30 Nov 2023 02:37:32 -0800 (PST)
Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se.
 [188.150.165.235]) by smtp.gmail.com with ESMTPSA id
 c11-20020a2e9d8b000000b002c9afbeb006sm107362ljj.129.2023.11.30.02.37.32
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 30 Nov 2023 02:37:32 -0800 (PST)
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattias.engdegard@HIDDEN>
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Subject: bug#67483: Wrong warning position given by the byte compiler for a
 malformed function
Message-Id: <59773797-CC64-4352-9528-4E7593DD3C1F@HIDDEN>
Date: Thu, 30 Nov 2023 11:37:31 +0100
To: Alan Mackenzie <acm@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67483
Cc: Stefan Monnier <monnier@HIDDEN>, 67483 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>     Buffer bad-error-position.el:2:4: Warning: `foo' is a malformed =
function
>=20
> ..  This position 2:4 is wrong; it is the position of the `let' =
symbol.
> The correct position would be 3:6, the position of the `if' symbol.

(Actually the correct position would be the position of the string =
literal but of course our location tracking system is too simplistic for =
that.)

Thank you for bringing this to our attention. Now I only saw this from =
the reference in your commit message; would you CC me next time? =
(Stefan, too, unless he objects.)

I'm modifying your work a bit because we're trying to remove warnings =
from the optimiser, not entrenching them there. The warning is now in =
cconv but perhaps it should be moved to macroexp-all, it's not very =
important. I hope being able to reshape the front-end a bit later on.

Also, we usually prefer let-binding dynamic variables to push-pop pairs.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67483; Package emacs. Full text available.

Message received at 67483-done <at> debbugs.gnu.org:


Received: (at 67483-done) by debbugs.gnu.org; 27 Nov 2023 15:48:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 27 10:48:03 2023
Received: from localhost ([127.0.0.1]:44610 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r7dq6-0003Q3-OQ
	for submit <at> debbugs.gnu.org; Mon, 27 Nov 2023 10:48:03 -0500
Received: from mail.muc.de ([193.149.48.3]:56272)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1r7dq4-0003Oq-TD
 for 67483-done <at> debbugs.gnu.org; Mon, 27 Nov 2023 10:48:01 -0500
Received: (qmail 27189 invoked by uid 3782); 27 Nov 2023 16:47:48 +0100
Received: from acm.muc.de (p4fe15c1a.dip0.t-ipconnect.de [79.225.92.26])
 (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Mon, 27 Nov 2023 16:47:48 +0100
Received: (qmail 636 invoked by uid 1000); 27 Nov 2023 15:47:47 -0000
Date: Mon, 27 Nov 2023 15:47:47 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#67483: Wrong warning position given by the byte compiler for
 a malformed function
Message-ID: <ZWS6I_CldqvHTQPk@ACM>
References: <ZWSOUXQufCLSlXBi@ACM> <83wmu38hje.fsf@HIDDEN>
 <ZWSXtnTlGL5yX9ES@ACM> <83ttp78fvi.fsf@HIDDEN>
 <ZWShRJsjgR8r3MGv@ACM> <83r0kb8c89.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83r0kb8c89.fsf@HIDDEN>
X-Submission-Agent: TMDA/1.3.x (Ph3nix)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67483-done
Cc: 67483-done <at> debbugs.gnu.org, acm@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Eli.

On Mon, Nov 27, 2023 at 17:09:10 +0200, Eli Zaretskii wrote:
> > Date: Mon, 27 Nov 2023 14:01:40 +0000
> > Cc: 67483 <at> debbugs.gnu.org, acm@HIDDEN
> > From: Alan Mackenzie <acm@HIDDEN>

> > > > > Which branch? master or emacs-29?

> > > > Both.  Probably emacs-28, too.

> > > So it isn't a "semi-recent" problem, is it?

> > It isn't ten years old, either.  I have a fix ready to commit to the
> > master branch.

> > Seeing as how the bug isn't recently introduced, and isn't a critical
> > bug, I'm assuming the patch is not destined for the release branch.

> Definitely not.

No.  I've committed the fix to master, and I'm closing the bug.

-- 
Alan Mackenzie (Nuremberg, Germany).




Notification sent to Alan Mackenzie <acm@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Alan Mackenzie <acm@HIDDEN>:
You have taken responsibility. Full text available.

Message received at 67483 <at> debbugs.gnu.org:


Received: (at 67483) by debbugs.gnu.org; 27 Nov 2023 15:09:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 27 10:09:44 2023
Received: from localhost ([127.0.0.1]:44589 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r7dF2-0002U3-Ge
	for submit <at> debbugs.gnu.org; Mon, 27 Nov 2023 10:09:44 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:42184)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1r7dEz-0002To-Cu
 for 67483 <at> debbugs.gnu.org; Mon, 27 Nov 2023 10:09:42 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1r7dEn-0007Gt-Kg; Mon, 27 Nov 2023 10:09:29 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=bqetSdYuN8X6TSxJKK4nYn3EK+Zb7r1Blsn8bsLpuAo=; b=YGYc8/L9rbKx
 HwG2aXfTLDt/0TSFndwI7qGIqDRaoSSQzRdORLyQ52HjZW1XHODR4j7iACLljdZOFiu7RCHiF25Eg
 4f7r4Im6kfDHg9qCwwcvd5lsxxU2dGHSVUPWxk682oHB8bCAxZmYg+DIlYzTNjE/OfNPS0ii59gwc
 RP/ogQoB6QvVTc+QAIcbJcHEEJgowxc+LnH+HkiXY6mxHptw57rBOJIuw91K9h2Mn4o8vw1GhKEDN
 xwqdTmAsGqV69/v6kW5wcr99dTO9aHIn1lgpmT7kqpy+7iq29A1cj0NCtzIFm99psq7tzO14V0dZr
 QBaK0Nc36GAdsLMbiu4f5g==;
Date: Mon, 27 Nov 2023 17:09:10 +0200
Message-Id: <83r0kb8c89.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
In-Reply-To: <ZWShRJsjgR8r3MGv@ACM> (message from Alan Mackenzie on Mon, 27
 Nov 2023 14:01:40 +0000)
Subject: Re: bug#67483: Wrong warning position given by the byte compiler for
 a malformed function
References: <ZWSOUXQufCLSlXBi@ACM> <83wmu38hje.fsf@HIDDEN>
 <ZWSXtnTlGL5yX9ES@ACM>
 <83ttp78fvi.fsf@HIDDEN> <ZWShRJsjgR8r3MGv@ACM>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 67483
Cc: acm@HIDDEN, 67483 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 27 Nov 2023 14:01:40 +0000
> Cc: 67483 <at> debbugs.gnu.org, acm@HIDDEN
> From: Alan Mackenzie <acm@HIDDEN>
> 
> > > > Which branch? master or emacs-29?
> 
> > > Both.  Probably emacs-28, too.
> 
> > So it isn't a "semi-recent" problem, is it?
> 
> It isn't ten years old, either.  I have a fix ready to commit to the
> master branch.
> 
> Seeing as how the bug isn't recently introduced, and isn't a critical
> bug, I'm assuming the patch is not destined for the release branch.

Definitely not.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67483; Package emacs. Full text available.

Message received at 67483 <at> debbugs.gnu.org:


Received: (at 67483) by debbugs.gnu.org; 27 Nov 2023 14:01:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 27 09:01:56 2023
Received: from localhost ([127.0.0.1]:43564 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r7cBP-0000TI-L0
	for submit <at> debbugs.gnu.org; Mon, 27 Nov 2023 09:01:55 -0500
Received: from mail.muc.de ([193.149.48.3]:25215)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1r7cBN-0000T3-UZ
 for 67483 <at> debbugs.gnu.org; Mon, 27 Nov 2023 09:01:54 -0500
Received: (qmail 4715 invoked by uid 3782); 27 Nov 2023 15:01:41 +0100
Received: from acm.muc.de (p4fe15c1a.dip0.t-ipconnect.de [79.225.92.26])
 (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Mon, 27 Nov 2023 15:01:41 +0100
Received: (qmail 23794 invoked by uid 1000); 27 Nov 2023 14:01:40 -0000
Date: Mon, 27 Nov 2023 14:01:40 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#67483: Wrong warning position given by the byte compiler for
 a malformed function
Message-ID: <ZWShRJsjgR8r3MGv@ACM>
References: <ZWSOUXQufCLSlXBi@ACM> <83wmu38hje.fsf@HIDDEN>
 <ZWSXtnTlGL5yX9ES@ACM> <83ttp78fvi.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83ttp78fvi.fsf@HIDDEN>
X-Submission-Agent: TMDA/1.3.x (Ph3nix)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67483
Cc: acm@HIDDEN, 67483 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Eli.

On Mon, Nov 27, 2023 at 15:50:25 +0200, Eli Zaretskii wrote:
> > Date: Mon, 27 Nov 2023 13:20:54 +0000
> > Cc: 67483 <at> debbugs.gnu.org, acm@HIDDEN
> > From: Alan Mackenzie <acm@HIDDEN>

> > On Mon, Nov 27, 2023 at 15:14:29 +0200, Eli Zaretskii wrote:
> > > > Date: Mon, 27 Nov 2023 12:40:49 +0000
> > > > From: Alan Mackenzie <acm@HIDDEN>

> > > > In any recent or semi-recent Emacs create a file bad-error-position.el
> > > > with these contents:

> > > Which branch? master or emacs-29?

> > Both.  Probably emacs-28, too.

> So it isn't a "semi-recent" problem, is it?

It isn't ten years old, either.  I have a fix ready to commit to the
master branch.

Seeing as how the bug isn't recently introduced, and isn't a critical
bug, I'm assuming the patch is not destined for the release branch.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67483; Package emacs. Full text available.

Message received at 67483 <at> debbugs.gnu.org:


Received: (at 67483) by debbugs.gnu.org; 27 Nov 2023 13:51:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 27 08:51:01 2023
Received: from localhost ([127.0.0.1]:43553 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r7c0r-0000C6-De
	for submit <at> debbugs.gnu.org; Mon, 27 Nov 2023 08:51:01 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:39300)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1r7c0q-0000Bs-9z
 for 67483 <at> debbugs.gnu.org; Mon, 27 Nov 2023 08:51:00 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1r7c0e-0007OV-30; Mon, 27 Nov 2023 08:50:48 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=b7u8bg5s060ntHYf1uQK2n1QAIjogc2ZkiKbz6dau8c=; b=HspLVT8dJIUu
 +pO+/jC9wFlQc1Dh3YKaC4344y8HtR8V/gLBswCDrqSDYqoH8zQzYIfXyiekoLVox9b0UpMXDCBFG
 ++UOIjEVxvk2oZK4aW5/oSqE+bReVcWIv5B3PS+6TlT/dGnsxA2RwXCIAB8tJ88ZcLO3naEcpZ9u1
 XqGmB2NIhAoGo770PuRt2XmOUTRNfGrLbHKWqZnhglJuCkn2nlfuG6jtODCPp0/5mx41Q7udb+qWp
 LZ8jEtxl515LtuvfFxHshRtk78pcg06YsJpWWDn48WEet8jI3M2J1jQBi3inHbzndU7UONk+awrz/
 pMTy8ozhucu44IcwpkELRw==;
Date: Mon, 27 Nov 2023 15:50:25 +0200
Message-Id: <83ttp78fvi.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
In-Reply-To: <ZWSXtnTlGL5yX9ES@ACM> (message from Alan Mackenzie on Mon, 27
 Nov 2023 13:20:54 +0000)
Subject: Re: bug#67483: Wrong warning position given by the byte compiler for
 a malformed function
References: <ZWSOUXQufCLSlXBi@ACM>
 <83wmu38hje.fsf@HIDDEN> <ZWSXtnTlGL5yX9ES@ACM>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 67483
Cc: acm@HIDDEN, 67483 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 27 Nov 2023 13:20:54 +0000
> Cc: 67483 <at> debbugs.gnu.org, acm@HIDDEN
> From: Alan Mackenzie <acm@HIDDEN>
> 
> Hello, Eli.
> 
> On Mon, Nov 27, 2023 at 15:14:29 +0200, Eli Zaretskii wrote:
> > > Date: Mon, 27 Nov 2023 12:40:49 +0000
> > > From: Alan Mackenzie <acm@HIDDEN>
> 
> > > In any recent or semi-recent Emacs create a file bad-error-position.el
> > > with these contents:
> 
> > Which branch? master or emacs-29?
> 
> Both.  Probably emacs-28, too.

So it isn't a "semi-recent" problem, is it?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67483; Package emacs. Full text available.

Message received at 67483 <at> debbugs.gnu.org:


Received: (at 67483) by debbugs.gnu.org; 27 Nov 2023 13:21:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 27 08:21:10 2023
Received: from localhost ([127.0.0.1]:43520 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r7bXy-0007nZ-5H
	for submit <at> debbugs.gnu.org; Mon, 27 Nov 2023 08:21:10 -0500
Received: from mail.muc.de ([193.149.48.3]:26231)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1r7bXw-0007mc-Q3
 for 67483 <at> debbugs.gnu.org; Mon, 27 Nov 2023 08:21:09 -0500
Received: (qmail 58297 invoked by uid 3782); 27 Nov 2023 14:20:54 +0100
Received: from acm.muc.de (p4fe15c1a.dip0.t-ipconnect.de [79.225.92.26])
 (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Mon, 27 Nov 2023 14:20:54 +0100
Received: (qmail 23749 invoked by uid 1000); 27 Nov 2023 13:20:54 -0000
Date: Mon, 27 Nov 2023 13:20:54 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#67483: Wrong warning position given by the byte compiler for
 a malformed function
Message-ID: <ZWSXtnTlGL5yX9ES@ACM>
References: <ZWSOUXQufCLSlXBi@ACM>
 <83wmu38hje.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83wmu38hje.fsf@HIDDEN>
X-Submission-Agent: TMDA/1.3.x (Ph3nix)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 67483
Cc: acm@HIDDEN, 67483 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Eli.

On Mon, Nov 27, 2023 at 15:14:29 +0200, Eli Zaretskii wrote:
> > Date: Mon, 27 Nov 2023 12:40:49 +0000
> > From: Alan Mackenzie <acm@HIDDEN>

> > In any recent or semi-recent Emacs create a file bad-error-position.el
> > with these contents:

> Which branch? master or emacs-29?

Both.  Probably emacs-28, too.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67483; Package emacs. Full text available.

Message received at 67483 <at> debbugs.gnu.org:


Received: (at 67483) by debbugs.gnu.org; 27 Nov 2023 13:14:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 27 08:14:58 2023
Received: from localhost ([127.0.0.1]:43505 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r7bRy-0007cG-2Y
	for submit <at> debbugs.gnu.org; Mon, 27 Nov 2023 08:14:58 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:35356)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1r7bRw-0007c4-Hh
 for 67483 <at> debbugs.gnu.org; Mon, 27 Nov 2023 08:14:56 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1r7bRk-0008Vb-9x; Mon, 27 Nov 2023 08:14:44 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=ktLsnNXdtuRMDFplVv/pkkaDc/SgXnMp/8HUWYO21mQ=; b=CdwJy/Ic8Cq3
 LDgjueCLixIhl/4kcr8dfInph8QOi+Rgf/51jqs6VXPCR25I62VMjjN/x+IC0B/PNUbH7W9zPzD4J
 NHZeFDUDob5O/wSOKNXqSE6z7o+sc1aMzCS8W+qf9LRccszav2Za0t1Mbxx97DUav5VV8L2idWadK
 HGStGRFkYkFYrSdlijFsruNARCG9cLV1iPMXPYO4CGre+ZBzZrU2BM9ls1iPs9gjTDU390S01gzcY
 +JiQnV2skC1nSXrujEBTB5eEVHJytgvRBviKojrD6CL9gs6AWK26jfnDf5tWGYJ1SYxGDhNh+xTd5
 xXijdgpAAG7jB67mwDIwbQ==;
Date: Mon, 27 Nov 2023 15:14:29 +0200
Message-Id: <83wmu38hje.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
In-Reply-To: <ZWSOUXQufCLSlXBi@ACM> (message from Alan Mackenzie on Mon, 27
 Nov 2023 12:40:49 +0000)
Subject: Re: bug#67483: Wrong warning position given by the byte compiler for a
 malformed function
References: <ZWSOUXQufCLSlXBi@ACM>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 67483
Cc: 67483 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 27 Nov 2023 12:40:49 +0000
> From: Alan Mackenzie <acm@HIDDEN>
> 
> In any recent or semi-recent Emacs create a file bad-error-position.el
> with these contents:

Which branch? master or emacs-29?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#67483; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 27 Nov 2023 12:41:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 27 07:41:19 2023
Received: from localhost ([127.0.0.1]:43456 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r7avO-0006fA-MW
	for submit <at> debbugs.gnu.org; Mon, 27 Nov 2023 07:41:19 -0500
Received: from lists.gnu.org ([2001:470:142::17]:32984)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1r7avN-0006el-B0
 for submit <at> debbugs.gnu.org; Mon, 27 Nov 2023 07:41:17 -0500
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 <acm@HIDDEN>) id 1r7avB-0005ea-A0
 for bug-gnu-emacs@HIDDEN; Mon, 27 Nov 2023 07:41:05 -0500
Received: from mail.muc.de ([193.149.48.3])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <acm@HIDDEN>) id 1r7av9-0002Ea-C9
 for bug-gnu-emacs@HIDDEN; Mon, 27 Nov 2023 07:41:05 -0500
Received: (qmail 10969 invoked by uid 3782); 27 Nov 2023 13:40:50 +0100
Received: from acm.muc.de (p4fe15c1a.dip0.t-ipconnect.de [79.225.92.26])
 (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Mon, 27 Nov 2023 13:40:49 +0100
Received: (qmail 25339 invoked by uid 1000); 27 Nov 2023 12:40:49 -0000
Date: Mon, 27 Nov 2023 12:40:49 +0000
To: bug-gnu-emacs@HIDDEN
Subject: Wrong warning position given by the byte compiler for a malformed
 function
Message-ID: <ZWSOUXQufCLSlXBi@ACM>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Submission-Agent: TMDA/1.3.x (Ph3nix)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
Received-SPF: pass client-ip=193.149.48.3; envelope-from=acm@HIDDEN;
 helo=mail.muc.de
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

Hello, Emacs

In any recent or semi-recent Emacs create a file bad-error-position.el
with these contents:

    (defun foo ()
      (let ((bar 'bar))
        (if ("foo")  ; Erroneous "function".
            (baz))))))

..  Use M-x compile-defun to compile it.  This gives an error message:

    Buffer bad-error-position.el:2:4: Warning: `foo' is a malformed function

..  This position 2:4 is wrong; it is the position of the `let' symbol.
The correct position would be 3:6, the position of the `if' symbol.

#########################################################################

The cause of the error is in byte-optimize-form in
lisp/emacs-lisp/byte-opt.el.  There, although the code recurses, it
fails to push the current form onto byte-compile-form-stack.  Thus when
byte-compile-warn-x is called, there is nothing usable on that stack
inside the let form.

-- 
Alan Mackenzie (Nuremberg, Germany).




Acknowledgement sent to Alan Mackenzie <acm@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#67483; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 20 Jan 2024 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.