From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#43678: 27.1; compiler warning if code forgets to require cl-lib Date: Mon, 28 Sep 2020 15:19:55 -0400 Message-ID: References: <10063.90714.979619.24434@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24049"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 43678@debbugs.gnu.org To: "Roland Winkler" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 28 21:21:14 2020 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 1kMyi2-00066d-E9 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Sep 2020 21:21:14 +0200 Original-Received: from localhost ([::1]:41696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMyi1-0005Ff-09 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Sep 2020 15:21:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMyhq-0005FH-6v for bug-gnu-emacs@gnu.org; Mon, 28 Sep 2020 15:21:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42494) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMyhp-0000OH-TL for bug-gnu-emacs@gnu.org; Mon, 28 Sep 2020 15:21:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kMyhp-00024R-Pj for bug-gnu-emacs@gnu.org; Mon, 28 Sep 2020 15:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Sep 2020 19:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43678 X-GNU-PR-Package: emacs Original-Received: via spool by 43678-submit@debbugs.gnu.org id=B43678.16013208057880 (code B ref 43678); Mon, 28 Sep 2020 19:21:01 +0000 Original-Received: (at 43678) by debbugs.gnu.org; 28 Sep 2020 19:20:05 +0000 Original-Received: from localhost ([127.0.0.1]:54040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMygv-000231-Hr for submit@debbugs.gnu.org; Mon, 28 Sep 2020 15:20:05 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:28035) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMygu-00022S-AO for 43678@debbugs.gnu.org; Mon, 28 Sep 2020 15:20:04 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E36A780739; Mon, 28 Sep 2020 15:19:58 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 8864C805B8; Mon, 28 Sep 2020 15:19:56 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1601320796; bh=E18BFxRGLKsy8pL0aLpvK8QBXQCrkHX+BD2QIE4ork0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=HW2wymcp0XHHYb1C8/qkj9jsslxX3yAvdfhUWBVD33qknv/4vwl6eCqsg1AAubUN4 XCMaSkfkbUhUVhJphdn2kHNi+hhLme4tm58Vfv6lzjgHZTmEew60BwyaLmnK8OrJdf fQ2OtCZj6ZnvBC/dhNL5Ct1pe1thLPm/GmyuPtV7L+D0bDLtcxTQ5/0pYZKgtwe6rR HatvlwOiSoeYhtul1iMLyDVNehLJdodTPJ14/+SjEP9Ds7bZEe63nEn4/D6PuHmbRb mHe+ry0YCoN7grxFA8Y6G741G4eNTmWl9IOe3xdQtYuEKjsIHoEzlTWC+IW/tyD7S+ 4vhhdEBkgF1zg== Original-Received: from alfajor (unknown [45.72.232.131]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5EE49120201; Mon, 28 Sep 2020 15:19:56 -0400 (EDT) In-Reply-To: <10063.90714.979619.24434@gargle.gargle.HOWL> (Roland Winkler's message of "Mon, 28 Sep 2020 20:11:27 +0200") 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" Xref: news.gmane.io gmane.emacs.bugs:189220 Archived-At: > Until earlier today, several files in bbdb did not require cl-lib, > when they should have done that. Nonetheless, bbdb compiled fine > with emacs 25 and 26, but not anymore with emacs 27, see bug #30635. > The goal when fixing #30635 was to issue a warning if a library uses > cl-lib without requiring it. The problem with bbdb was, however, > that instead the emacs 27 byte compiler threw a rather unhelpful > error message about the cause of the problem. For bbdb-tex.el, it > said > > In bbdb-TeX: > bbdb-tex.el:414:25:Error: Forgot to expand macro cl-progv in ( ... > > I suggest that the byte compiler should issue a more helpful warning > about the cause of the problem. Could you show how you got that error? When I try to compile bbdb-tex.el I get the following: % src/emacs -L .../elpa/packages/bbdb/ -Q --batch -f batch-byte-compile= .../elpa/packages/bbdb/bbdb-tex.el =20=20=20=20 In end of data: .../elpa/packages/bbdb/bbdb-tex.el:568:1: Warning: the function =E2=80= =98cl-progv=E2=80=99 is not known to be defined. % Which is the source of the error and which I hoped was "helpful enough". This is just a "warning" but it actually results in the file being miscompiled. The byte-compiler only issues a warning rather than an error because it doesn't know `cl-progv` (and hence doesn't know that it's a macro either) at that point and hence just assumes that it will be defined as a function. If you later load that `bbdb-tex.elc` file and use the `bbdb-tex` function, when it gets to the point of executing the code with the `cl-progv` it will indeed signal something like the error you've shown (because the byte code tries to call the `cl-progv` *function* but finds a *macro* in its stead). Stefan