GNU bug report logs -
#30635
No compiler warning if code forgets to require cl-lib
Previous Next
Reported by: Glenn Morris <rgm <at> gnu.org>
Date: Tue, 27 Feb 2018 18:47:02 UTC
Severity: normal
Found in version 26.0.91
Fixed in version 27.1
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
>>>> There's no compiler warning if a library uses cl-lib without requiring it.
>>>> I assume this is because bytecomp.el requires cl-lib.
>>> Should we apply the patch below?
>> Works for me, thanks.
> Doesn't work for me, OTOH:
[...]
> and if you look at `dir-locals-read-from-dir`, you'll see that it does
> (require 'map) and then uses its `map-merge(-with)`.
And if I tweak dir-locals-read-from-dir so it doesn't require `map`, and
then try to compile a file like gnus-cloud.el where I removed all the
`require`s, I still get:
% src/emacs --batch --eval "(eval-after-load 'cl-lib '(debug t))" -f batch-byte-compile lisp/gnus/gnus-cloud.el
Debugger entered--beginning evaluation of function call form:
(lambda nil (debug t))()
[...]
require(cl-lib)
byte-code("\300\301!\210\300\302!\210\300\303!\207" [require cl-lib macroexp gv] 2)
cl--defsubst-expand((cl-x) (cl-block epg-context-armor (or (cl--struct-epg-context-p cl-x) (signal 'wrong-type-argument (list 'epg-context cl-x))) (aref cl-x 4)) nil nil nil context)
epg-context-armor--cmacro((epg-context-armor context) context)
apply(epg-context-armor--cmacro (epg-context-armor context) context)
gv-get((epg-context-armor context) #f(compiled-function (getter setter) #<bytecode 0x57f35d>))
[...]
macroexpand-all((defalias 'gnus-cloud-encode-data ...) ...)
[...]
byte-compile-recurse-toplevel((defun gnus-cloud-encode-data ...) ...)
The end result is better tho; if I then add a call to `cl-every` into
that file, I do get a warning of the form:
gnus/gnus-cloud.el:512:1:Warning: the function ‘cl-every’ might not be
defined at runtime.
So I pushed the previous two patches to master, since I think they at
least partly fix this bug.
Stefan
This bug report was last modified 7 years and 55 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.