Commit 64cea555 authored by Glenn Morris's avatar Glenn Morris

(check-declare-verify): Fix previous change. Warn if could not find

an arglist to check.
parent d5cf82de
......@@ -108,17 +108,22 @@ ine-derived-mode\\|ine-minor-mode\\|alias[ \t]+'\\)\\)\
;; (min . max) for a fixed number of arguments, or
;; arglists with optional elements.
;; (min) for arglists with &rest.
;; sig = 'err means we could not find an arglist.
sig (cond (cflag
(re-search-forward "," nil t 3)
(when (re-search-forward "," nil t 3)
(skip-chars-forward " \t\n")
;; Assuming minargs and maxargs on same line.
(when (looking-at "\\([0-9]+\\)[ \t]*,[ \t]*\
(setq minargs (string-to-number (match-string 1))
(setq minargs (string-to-number
(match-string 1))
maxargs (match-string 2))
(cons minargs (unless (string-match "[^0-9]"
(string-to-number maxargs)))))
((string-equal (match-string 1)
'(0 . 0))
......@@ -129,24 +134,29 @@ ine-derived-mode\\|ine-minor-mode\\|alias[ \t]+'\\)\\)\
((string-equal (match-string 1)
(if (looking-at "\\((\\|nil\\)")
((looking-at "\\((\\|nil\\)")
(read (current-buffer))))))
(read (current-buffer))))
;; alist of functions and arglist signatures.
siglist (cons (cons fn sig) siglist)))))
(dolist (e fnlist)
(setq arglist (nth 2 e)
(if re ; re non-nil means found a file
(if (setq sig (assoc (cadr e) siglist))
(if (setq sig (assoc (cadr e) siglist)) ; found function
;; Recall we use t to mean no arglist specified,
;; to distinguish from an empty arglist.
(unless (or (eq arglist t)
(eq sig t))
(unless (equal (byte-compile-arglist-signature arglist)
(cdr sig))
"arglist mismatch"))
(unless (eq arglist t)
(setq sig (cdr-safe sig))
(cond ((eq sig t)) ; defalias, can't check
((eq sig 'err)
"arglist not found") ; internal error
((not (equal (byte-compile-arglist-signature
"arglist mismatch")))
"function not found")
"file not found"))
(when type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment