From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jeremy Bryant via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs 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 Message-ID: <87ttgbalza.fsf@jeremybryant.net> References: <874j8bx5gr.fsf@gnu.org> Reply-To: Jeremy Bryant Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32857"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72313@debbugs.gnu.org, Stefan Monnier To: Tassilo Horn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 26 23:22:28 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sXSOQ-0008N4-MB for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Jul 2024 23:22:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sXSO3-0001w9-0D; Fri, 26 Jul 2024 17:22:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sXSNz-0001ve-0S for bug-gnu-emacs@gnu.org; Fri, 26 Jul 2024 17:22:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sXSNt-0004nS-Tj for bug-gnu-emacs@gnu.org; Fri, 26 Jul 2024 17:21:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sXSO2-0006d8-JG for bug-gnu-emacs@gnu.org; Fri, 26 Jul 2024 17:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jeremy Bryant Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Jul 2024 21:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72313 X-GNU-PR-Package: emacs Original-Received: via spool by 72313-submit@debbugs.gnu.org id=B72313.172202887925433 (code B ref 72313); Fri, 26 Jul 2024 21:22:02 +0000 Original-Received: (at 72313) by debbugs.gnu.org; 26 Jul 2024 21:21:19 +0000 Original-Received: from localhost ([127.0.0.1]:40129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXSNK-0006c9-QJ for submit@debbugs.gnu.org; Fri, 26 Jul 2024 17:21:19 -0400 Original-Received: from out-185.mta0.migadu.com ([91.218.175.185]:58396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXSNI-0006be-2K for 72313@debbugs.gnu.org; Fri, 26 Jul 2024 17:21:17 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeremybryant.net; s=key1; t=1722028859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RyABsTYeYozmGMp7YAb4kGaP2/Ess/sLAW+SzxHYiQs=; b=YTr5SLzh1qhfTBqFsRzMNE/7oh+Fyl/SHxnrI2Qnzxp4nmdFlwrL8tppJdK8/rRqp673wt ELJejR59mSOnakRj32m0MNl+wH3oSvI4mMnthih8UQ85Ma2WdgiNEVTLH0eqsw5+kvsGkx LTZKb0SnqqUyYJ2a9gU4MRWcHX9Oy+qQ0lv+3XSlsfjKBcK3k0XF2OMbwO1eTQQzo3optb MpRkzLKQWD7K4me4nndm8IYDaO9GstusOKsYZTQvfohXwPaK5nfq6QReDZe0SAsx0tiflW cZNaPJA97YOz3dRV6i320wSp3i+46l8pUgYs16RCNm0FeH27D3DyesOzxWnOGg== In-Reply-To: <874j8bx5gr.fsf@gnu.org> (Tassilo Horn's message of "Fri, 26 Jul 2024 22:29:08 +0200") X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289390 Archived-At: Tassilo Horn writes: > The following non-sensical code is a MWE triggering the warning > > test.el: Warning: the function =E2=80=98cl-member=E2=80=99 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.