emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: The `cl-functions' byte compiler warning doesn't wor


From: Johan Bockgård
Subject: Re: address@hidden: The `cl-functions' byte compiler warning doesn't work]
Date: Mon, 03 Mar 2008 11:08:00 +0100
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux)

So, byte-compile-find-cl-functions still has a few problems:

1. It expects functions to be represented by plain symbols
rather than (defun . FOO) in load-history.

2. It modifies load-history as a side-effect.

3.  byte-compile-cl-functions contains useless `(require/t/provide
    ...)' entries.


This illustrates the problem:

    $ emacs -Q

    (require 'cl)

    (byte-compile (lambda () (subst nil nil nil)))
      => no warning

    (byte-compile (lambda () (subst-if nil nil nil)))
      => Warning: Function `subst-if' from cl package called at runtime

    ;; The (autoload . <CL-FUNCTION>) entries in `load-history' are
       gone.


How about this version:

(defun byte-compile-find-cl-functions ()
  (unless byte-compile-cl-functions
    (dolist (elt load-history)
      (when (and (stringp (car elt))
                 (string-match
                  "^cl\\>" (file-name-nondirectory (car elt))))
        (dolist (e (cdr elt))
          (when (memq (car-safe e) '(autoload defun))
            (push (cdr e) byte-compile-cl-functions)))))))

2008-03-03 Johan Bockgård <address@hidden>

        * emacs-lisp/bytecomp.el (byte-compile-find-cl-functions):
        Simplify.  Collect `defun' and `autoload' entries.  Avoid
        side-effecting load-history.



And I see now that Martin's change wasn't checked in on the branch,
which means that the original problem in this thread exists there (the
compiler never warns about cl functions):


2007-06-10  Martin Rudalics  <address@hidden>

        * emacs-lisp/bytecomp.el (byte-compile-find-cl-functions):
        Match against file-name-nondirectory.


-- 
Johan Bockgård





reply via email to

[Prev in Thread] Current Thread [Next in Thread]