GNU bug report logs - #30635
No compiler warning if code forgets to require cl-lib

Previous Next

Package: emacs;

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 30635 <at> debbugs.gnu.org
Subject: bug#30635: No compiler warning if code forgets to require cl-lib
Date: Thu, 22 Mar 2018 17:53:01 -0400
>>> 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:

    % src/emacs --batch --eval "(eval-after-load 'cl-lib '(debug t))"  -f batch-byte-compile lisp/emacs-lisp/bytecomp.el
    Debugger entered--beginning evaluation of function call form:
      (lambda nil (debug t))()
      eval-after-load-helper("/home/monnier/src/emacs/trunk/lisp/emacs-lisp/cl-lib.elc")
      run-hook-with-args(eval-after-load-helper "/home/monnier/src/emacs/trunk/lisp/emacs-lisp/cl-lib.elc")
      do-after-load-evaluation("/home/monnier/src/emacs/trunk/lisp/emacs-lisp/cl-lib.elc")
      require(cl-lib)
      require(seq)
      require(map)
      dir-locals-read-from-dir("/home/monnier/src/emacs/trunk/")
      hack-dir-local-variables()
      hack-local-variables(no-mode)
      normal-mode(t)
      byte-compile-file("lisp/emacs-lisp/bytecomp.el")
      batch-byte-compile-file("lisp/emacs-lisp/bytecomp.el")
      batch-byte-compile()
      command-line-1(("--eval" "(eval-after-load 'cl-lib '(debug t))" "-f" "batch-byte-compile" "lisp/emacs-lisp/bytecomp.el"))
      command-line()
      normal-top-level()

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


        Stefan "the pressure to preload cl-lib is definitely mounting"




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.