[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#72313: 31.0.50; Warning about cl-member possibly being undefined whe
From: |
Jeremy Bryant |
Subject: |
bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew |
Date: |
Fri, 26 Jul 2024 22:20:57 +0100 |
Tassilo Horn <tsdh@gnu.org> writes:
> The following non-sensical code is a MWE triggering the warning
>
> test.el: Warning: the function ‘cl-member’ might not be defined
> at runtime.
>
> when byte-compiling it with
>
> emacs -Q --batch -f batch-byte-compile test.el
>
> --8<---------------cut here---------------start------------->8---
> ;; -*- lexical-binding: t; -*-
> (eval-when-compile
> (require 'cl-lib))
>
> (defun foo ()
> (let ((s (list 'a 'b)))
> (cl-pushnew (list 1 2 3)
> s
> :test (lambda (_a _b) nil))))
> --8<---------------cut here---------------end--------------->8---
>
> Code with that shape of cl-pushnew usage can be found in AUCTeX's
> tex-info.el where it produces the same warning which sounds very strange
> given that the complete file doesn't use cl-member.
>
> I've checked the cl-lib code and could see that cl-pushnew expands to
> something with cl-adjoin which in turn has a compiler macro
> cl-compiler-macro-adjoin which could expand to something with cl-member
> (but doesn't in this case, I think?)...
>
> My assumption is that (eval-when-compile (require 'cl-lib)) should be
> fine when using only macros from cl-lib which in turn should expand to
> cl-free code, i.e., the byte code doesn't require cl-lib at runtime.
> If, however, cl-pushnew can expand to something using cl-member (a
> function), that wouldn't be true.
Adding Stefan M.
- bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew, Tassilo Horn, 2024/07/26
- bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew,
Jeremy Bryant <=
- bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew, Stefan Monnier, 2024/07/27
- bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew, Tassilo Horn, 2024/07/27
- bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew, Stefan Monnier, 2024/07/27
- bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew, Arash Esbati, 2024/07/27
- bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew, Tassilo Horn, 2024/07/27
- bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew, Arash Esbati, 2024/07/27
- bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew, Tassilo Horn, 2024/07/31
- bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew, Arash Esbati, 2024/07/31
- bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew, Eli Zaretskii, 2024/07/28