bug#40188: check-declare-files does not include malformed declarations in the list

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#40188: check-declare-files does not include malformed declarations in the list

Neil Okamoto

As noted in the subject line: malformed declarations are noted by ‘check-declare-scan’ which logs a message in the ‘check-declare-warning-buffer’.  However that malformed declaration is not passed back to 'check-declare-files’, and therefore its not part of the error list returned from that function.

Software that uses  'check-declare-files' as a lint check would have to parse the warning buffer (an additional step) in order to catch these malformed declarations.

Reply | Threaded
Open this post in threaded view
|

bug#40188: repro for Emacs 26.3 and 27.0.90

Neil Okamoto
I’ve confirmed this bug in 26.3 as well as a local build of 27.0.90.
Here’s a simple repro. Save this in a file and run check-declare-file.






test.el (413 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#40188: repro for Emacs 26.3 and 27.0.90

Neil Okamoto
;; repro for 40188:

;; evaluate:
;;     (check-declare-file "test.el")
;; yields:
;;     (("../../tmp/check-declare/some-file.el"
;;       ("/tmp/check-declare/test.el" "bar" "file not found")))
;; 
;; which omits the second declare-function, which is malformed 

(declare-function bar "some-file.el")
(declare-function foo ‘malformed)
;; end of file


On Mar 25, 2020, at 2:41 PM, Neil Okamoto <[hidden email]> wrote:

I’ve confirmed this bug in 26.3 as well as a local build of 27.0.90.
Here’s a simple repro. Save this in a file and run check-declare-file.

<test.el>