From unknown Fri Sep 12 12:57:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#55413: 29.0.50; False positives in check-declare-directory Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 May 2022 16:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55413 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 55413@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165254605124579 (code B ref -1); Sat, 14 May 2022 16:35:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 May 2022 16:34:11 +0000 Received: from localhost ([127.0.0.1]:47391 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npuiZ-0006OM-3L for submit@debbugs.gnu.org; Sat, 14 May 2022 12:34:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:51590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npuiX-0006OD-Bm for submit@debbugs.gnu.org; Sat, 14 May 2022 12:34:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npuiW-0008Sr-V3 for bug-gnu-emacs@gnu.org; Sat, 14 May 2022 12:34:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57082) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npuiW-0006dx-MR for bug-gnu-emacs@gnu.org; Sat, 14 May 2022 12:34:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:Subject:To:From:Date:in-reply-to: references; bh=TCHNR8w0lkjIPMK/dw4g5golhjpZvYpUknBLT75VVrE=; b=HXgcAUhKEnSGqz dH7zMH9dthtB0qrD5Tl6A6gij/Ez8Vi7wE1lry85zBK/+v4L9xZnTVVwuCC1KoSqdIObMDzFk5s2y H3R52cUtgaqSpysURZrGwO9CWEFTX+gu1dfipx9ge16IjX2b0h1dHQClMhXJwdZ9mB2XKoe5pwDJU GENL4WhZ5VbHTOkY4es3q59hvwkQ+Wdt4iXBtk7f8hpKfmrGpH9MUUNfwxI0PDygfhL2R9gBlf3ZX OPihUL3zNoxLRStepX4MAeh48O0tySWb3YZE+vCG6MnfQ/8CJCIzBpCzEl9gZVjt9oZWkA+D6lUGn NpMLRX6hWrIMo1WtJvJQ==; Received: from [87.69.77.57] (port=3329 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npuiW-0001hg-5L for bug-gnu-emacs@gnu.org; Sat, 14 May 2022 12:34:08 -0400 Date: Sat, 14 May 2022 19:33:56 +0300 Message-Id: <83bkw0kr9n.fsf@gnu.org> From: Eli Zaretskii MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) When 'check-declare-directory' is run on the 'lisp sub-directory of the Emacs source tree, it produces quite a few false positives for some advanced uses of Emacs Lisp. Below are examples of the problematic warnings and the Lisp code which triggers them: cedet/semantic/wisent/comp.el:68:Warning (check-declare): said ‘unknown function’ was defined in unknown file: Malformed declaration This is because the function was declared inside eval-when-compile: (eval-when-compile (defun wisent-context-name (name) <<<<<<<<<<<<<<<<<<<<<<< "Return the context name from NAME." (if (and name (symbolp name)) (intern (format "wisent-context-%s" name)) (error "Invalid context name: %S" name))) (defmacro wisent-defcontext (name &rest vars) "Define a context NAME that will bind variables VARS." (declare (indent 1)) (declare-function wisent-context-name nil (name)) <<<<<<<<<<<<<< progmodes/elisp-mode.el:779:Warning (check-declare): said ‘xref-make’ was defined in progmodes/xref.el: function not found This is because xref-make is a constructor: (xref--defstruct (xref-item (:constructor xref-make (summary location)) <<<<<<<< (:noinline t)) "An xref item describes a reference to a location somewhere." (summary nil :documentation "String which describes the location. comint.el:4029:Warning (check-declare): said ‘url-host’ was defined in url/url-parse.el: function not found Disable showing Disable logging This is because url-host "has a compiler macro". autoinsert.el:92:Warning (check-declare): said ‘sgml-tag’ was defined in textmodes/sgml-mode.el: function not found This is because sgml-tag is defined via define-skeleton. progmodes/gud.el:62:Warning (check-declare): said ‘gud-statement’ was defined in progmodes/gud.el: function not found This is because gud-statement is defined via gud-def: (gud-def gud-statement "!%e" "\C-e" "Execute Python statement at point.") obsolete/cust-print.el:240:Warning (check-declare): said ‘cust-print-original-format’ was defined in obsolete/cust-print.el: function not found This is because cust-print-original-format is defined like this: ;; Save emacs routines. (if (not (fboundp 'cust-print-original-prin1)) (mapc #'cust-print-set-function-cell '((cust-print-original-prin1 prin1) (cust-print-original-princ princ) (cust-print-original-print print) (cust-print-original-prin1-to-string prin1-to-string) (cust-print-original-format format) <<<<<<<<<<<<<<<<<<<< (cust-print-original-message message) (cust-print-original-error error)))) net/sieve.el:107:Warning (check-declare): said ‘sieve-manage-mode-menu’ was defined in net/sieve.el: function not found This is because sieve-manage-mode-menu is defined via easy-menu-define: (easy-menu-define sieve-manage-mode-menu sieve-manage-mode-map "Sieve Menu." '("Manage Sieve" ["Edit script" sieve-edit-script t] mail/rmail.el:227:Warning (check-declare): said ‘rmail-mime-entity-truncated’ was defined in mail/rmailmm.el: function not found This is because rmail-mime-entity-truncated is defined thusly: (defsubst rmail-mime-entity-set-truncated (entity truncated) (declare (obsolete (setf rmail-mime-entity-truncated) "28.1")) (setf (rmail-mime-entity-truncated entity) truncated)) gnus/gnus-registry.el:436:Warning (check-declare): said ‘nnselect-article-group’ was defined in gnus/nnselect.el: function not found This is because nnselect-article-group is defined via define-inline: (define-inline nnselect-article-group (article) "Return the group for ARTICLE." (inline-quote (nnselect-artitem-group (nnselect-artlist-article It would be nice if check-declare could be taught to DTRT with these. In case some Lisp construct is infeasible for analyzing correctly, perhaps some feature could be added to declare-function to cause check-declare shut up in those particular cases? In GNU Emacs 29.0.50 (build 1061, i686-pc-mingw32) of 2022-05-14 built on HOME-C4E4A596F7 Repository revision: aa98a7823835366a0f06a2103ac183d5f7e59054 Repository branch: master Windowing system distributor 'Microsoft Corp.', version 5.1.2600 System Description: Microsoft Windows XP Service Pack 3 (v5.1.0.2600) Configured using: 'configure -C --prefix=/d/usr --with-wide-int --enable-checking=yes,glyphs 'CFLAGS=-O0 -gdwarf-4 -g3'' Configured features: ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP XPM ZLIB Important settings: value of $LANG: ENU locale-coding-system: cp1255 Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr dabbrev emacsbug message mailcap yank-media rmc puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils checkdoc lisp-mnt thingatpt help-mode vc-git diff-mode easy-mmode vc-dispatcher cl-loaddefs cl-lib bug-reference seq gv subr-x byte-opt bytecomp byte-compile cconv warnings compile text-property-search comint ansi-color ring check-declare iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice simple cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 88977 8875) (symbols 48 10820 1) (strings 16 27407 2644) (string-bytes 1 764566) (vectors 16 14945) (vector-slots 8 217755 23919) (floats 8 33 26) (intervals 40 2440 114) (buffers 888 43))