From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67483: Wrong warning position given by the byte compiler for a malformed function Date: Mon, 04 Dec 2023 11:44:44 -0500 Message-ID: References: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29271"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 67483@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 04 17:46:11 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 1rAC5C-0007Ns-Ib for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Dec 2023 17:46:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAC4x-0001U3-W4; Mon, 04 Dec 2023 11:45:56 -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 1rAC4u-0001Cm-FO for bug-gnu-emacs@gnu.org; Mon, 04 Dec 2023 11:45:53 -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 1rAC4t-0004JS-Fl for bug-gnu-emacs@gnu.org; Mon, 04 Dec 2023 11:45:52 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rAC53-0003ml-TS for bug-gnu-emacs@gnu.org; Mon, 04 Dec 2023 11:46:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Dec 2023 16:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67483 X-GNU-PR-Package: emacs Original-Received: via spool by 67483-submit@debbugs.gnu.org id=B67483.170170832414505 (code B ref 67483); Mon, 04 Dec 2023 16:46:01 +0000 Original-Received: (at 67483) by debbugs.gnu.org; 4 Dec 2023 16:45:24 +0000 Original-Received: from localhost ([127.0.0.1]:35524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rAC4S-0003lt-6H for submit@debbugs.gnu.org; Mon, 04 Dec 2023 11:45:24 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63894) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rAC4P-0003lZ-2Z for 67483@debbugs.gnu.org; Mon, 04 Dec 2023 11:45:22 -0500 Original-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== Original-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) Original-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) In-Reply-To: (Alan Mackenzie's message of "Mon, 27 Nov 2023 12:40:49 +0000") 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:275518 Archived-At: > (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