GNU bug report logs -
#43678
27.1; compiler warning if code forgets to require cl-lib
Previous Next
Reported by: "Roland Winkler" <winkler <at> gnu.org>
Date: Mon, 28 Sep 2020 18:12:02 UTC
Severity: normal
Tags: fixed
Found in version 27.1
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 43678 <at> debbugs.gnu.org (full text, mbox):
> 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
In end of data:
.../elpa/packages/bbdb/bbdb-tex.el:568:1: Warning: the function ‘cl-progv’ 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
This bug report was last modified 4 years and 270 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.