From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Gildea Newsgroups: gmane.emacs.bugs Subject: bug#52105: comp-tests.el causes byte-compiler warnings Date: Thu, 25 Nov 2021 06:10:15 -0800 Message-ID: <3377181.1637849415@pental> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37423"; mail-complaints-to="usenet@ciao.gmane.io" To: 52105@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 25 15:11:30 2021 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 1mqFTG-0009Vd-H7 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Nov 2021 15:11:30 +0100 Original-Received: from localhost ([::1]:46532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqFTE-0007I2-Hk for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Nov 2021 09:11:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqFSq-0007BJ-NC for bug-gnu-emacs@gnu.org; Thu, 25 Nov 2021 09:11:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44676) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mqFSq-0003P7-D6 for bug-gnu-emacs@gnu.org; Thu, 25 Nov 2021 09:11:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mqFSq-0004wn-7W for bug-gnu-emacs@gnu.org; Thu, 25 Nov 2021 09:11:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Gildea Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Nov 2021 14:11:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52105 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: submit@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.163784942718651 (code B ref -1); Thu, 25 Nov 2021 14:11:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Nov 2021 14:10:27 +0000 Original-Received: from localhost ([127.0.0.1]:56222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqFSC-0004qJ-Fe for submit@debbugs.gnu.org; Thu, 25 Nov 2021 09:10:26 -0500 Original-Received: from tigger.sg.gildea.net ([99.65.78.170]:37988 helo=pental.sg.gildea.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqFSA-0004or-69 for submit@debbugs.gnu.org; Thu, 25 Nov 2021 09:10:23 -0500 Original-Received: from pental (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by pental.sg.gildea.net (Postfix) with ESMTPS id B627811DBA7A for ; Thu, 25 Nov 2021 06:10:15 -0800 (PST) X-Mailer: MH-E 8.6+git; nmh 1.7.1; Emacs 29.0.50 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" Xref: news.gmane.io gmane.emacs.bugs:220833 Archived-At: --=-=-= Content-Type: text/plain Package: emacs Version: 28.0.60 Tags: patch The following small patch eliminates all the compile-time warnings from comp-tests.el. This patch is against the master branch, but since the patch changes only test/, perhaps you would like me to re-work it for the emacs-28 branch. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=comp-tests-eliminate-compiler-warnings.patch Content-Description: remove compiler warnings from comp-tests.el diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 025bc2058e..16612965bd 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -27,14 +27,23 @@ (require 'ert) (require 'ert-x) -(require 'cl-lib) - -(defconst comp-test-src (ert-resource-file "comp-test-funcs.el")) - -(defconst comp-test-dyn-src (ert-resource-file "comp-test-funcs-dyn.el")) - -(when (featurep 'native-compile) +(eval-when-compile + (require 'cl-lib) (require 'comp) + (defconst comp-test-src (ert-resource-file "comp-test-funcs.el")) + (defconst comp-test-dyn-src (ert-resource-file "comp-test-funcs-dyn.el")) + (defconst comp-test-pure-src (ert-resource-file "comp-test-pure.el")) + (defconst comp-test-45603-src (ert-resource-file "comp-test-45603.el"))) +(eval-and-compile + (require 'comp-cstr) ;in eval-and-compile for its defstruct + ;; Load the test code here so the compiler can check the function + ;; names used in this file. + (load comp-test-src nil t) + (load comp-test-dyn-src nil t) + (load comp-test-pure-src nil t) + (load comp-test-45603-src nil t)) + +(when (native-comp-available-p) (message "Compiling tests...") (load (native-compile comp-test-src)) (load (native-compile comp-test-dyn-src))) @@ -352,6 +361,8 @@ interactive-form comp-test-interactive-form2-f))) (should-not (commandp #'comp-tests-doc-f))) +(declare-function comp-tests-free-fun-f nil) + (comp-deftest free-fun () "Check we are able to compile a single function." (eval '(defun comp-tests-free-fun-f () @@ -369,6 +380,8 @@ free-fun (should (equal (interactive-form #'comp-tests-free-fun-f) '(interactive)))) +(declare-function comp-tests/free\fun-f nil) + (comp-deftest free-fun-silly-name () "Check we are able to compile a single function." (eval '(defun comp-tests/free\fun-f ()) t) @@ -493,7 +506,7 @@ 45635-1 (comp-deftest 45603-1 () "" - (load (native-compile (ert-resource-file "comp-test-45603.el"))) + (load (native-compile comp-test-45603-src)) (should (fboundp #'comp-test-45603--file-local-name))) (comp-deftest 46670-1 () @@ -786,6 +799,8 @@ comp-tests-tco-checker (comp-tests-mentioned-p (comp-c-func-name 'comp-tests-tco-f "F" t) insn))))))) +(declare-function comp-tests-tco-f nil) + (comp-deftest tco () "Check for tail recursion elimination." (let ((native-comp-speed 3) @@ -814,6 +829,8 @@ comp-tests-fw-prop-checker-1 (or (comp-tests-mentioned-p 'concat insn) (comp-tests-mentioned-p 'length insn))))))) +(declare-function comp-tests-fw-prop-1-f nil) + (comp-deftest fw-prop-1 () "Some tests for forward propagation." (let ((native-comp-speed 2) @@ -1404,7 +1421,7 @@ pure (let ((native-comp-speed 3) (comp-post-pass-hooks '((comp-final comp-tests-pure-checker-1 comp-tests-pure-checker-2)))) - (load (native-compile (ert-resource-file "comp-test-pure.el"))) + (load (native-compile comp-test-pure-src)) (should (subr-native-elisp-p (symbol-function #'comp-tests-pure-caller-f))) (should (= (comp-tests-pure-caller-f) 4)) --=-=-=--