unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40188: check-declare-files does not include malformed declarations in the list
@ 2020-03-23  0:31 Neil Okamoto
  2020-03-25 21:41 ` bug#40188: repro for Emacs 26.3 and 27.0.90 Neil Okamoto
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Okamoto @ 2020-03-23  0:31 UTC (permalink / raw)
  To: 40188

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]


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.


[-- Attachment #2: Type: text/html, Size: 784 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#40188: repro for Emacs 26.3 and 27.0.90
  2020-03-23  0:31 bug#40188: check-declare-files does not include malformed declarations in the list Neil Okamoto
@ 2020-03-25 21:41 ` Neil Okamoto
  2020-03-25 22:19   ` Neil Okamoto
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Okamoto @ 2020-03-25 21:41 UTC (permalink / raw)
  To: 40188

[-- Attachment #1: Type: text/plain, Size: 148 bytes --]

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.


[-- Attachment #2: test.el --]
[-- Type: application/octet-stream, Size: 398 bytes --]

;; repro for 40188:
;;      http://debbugs.gnu.org/cgi/bugreport.cgi?bug=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 malformed case (symbol instead of filename) 

(declare-function bar "some-file.el")
(declare-function foo 'malformed)


[-- Attachment #3: Type: text/plain, Size: 3 bytes --]





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#40188: repro for Emacs 26.3 and 27.0.90
  2020-03-25 21:41 ` bug#40188: repro for Emacs 26.3 and 27.0.90 Neil Okamoto
@ 2020-03-25 22:19   ` Neil Okamoto
  2021-08-10 16:33     ` bug#40188: check-declare-files does not include malformed declarations in the list Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Okamoto @ 2020-03-25 22:19 UTC (permalink / raw)
  To: 40188

[-- Attachment #1: Type: text/plain, Size: 689 bytes --]

;; repro for 40188:
;;      http://debbugs.gnu.org/cgi/bugreport.cgi?bug=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 <neil.okamoto@gmail.com> 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>
> 
> 


[-- Attachment #2: Type: text/html, Size: 4994 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#40188: check-declare-files does not include malformed declarations in the list
  2020-03-25 22:19   ` Neil Okamoto
@ 2021-08-10 16:33     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-10 16:33 UTC (permalink / raw)
  To: Neil Okamoto; +Cc: 40188

Neil Okamoto <neil.okamoto@gmail.com> writes:

> ;; repro for 40188:
> ;;      http://debbugs.gnu.org/cgi/bugreport.cgi?bug=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)

Well, the doc string says that it "checks the veracity" of the
declare-function calls -- not that it checks whether they're malformed.

So I think the return value is working as intended.

However, it (now) pops up the following warning:

check.el:14:Warning (check-declare): said ‘foo’ was defined in unknown file:
    Malformed declaration

So it does warn about the malformed `declare-function' (but doesn't
include it in the return value).

I think this is probably working as intended on the whole, so I'm
closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-10 16:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-23  0:31 bug#40188: check-declare-files does not include malformed declarations in the list Neil Okamoto
2020-03-25 21:41 ` bug#40188: repro for Emacs 26.3 and 27.0.90 Neil Okamoto
2020-03-25 22:19   ` Neil Okamoto
2021-08-10 16:33     ` bug#40188: check-declare-files does not include malformed declarations in the list Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).