From: Noam Postavsky <npostavs@gmail.com>
To: Francis Wright <francis.j.wright@gmail.com>
Cc: 30499@debbugs.gnu.org, f.j.wright@live.co.uk
Subject: bug#30499: 26.0.91; Compiler warning cannot be suppressed
Date: Tue, 06 Mar 2018 09:06:12 -0500 [thread overview]
Message-ID: <87y3j51ep7.fsf@gmail.com> (raw)
In-Reply-To: <85606vbx34.fsf@gmail.com> (Francis Wright's message of "Sat, 17 Feb 2018 12:49:03 +0000")
found 30499 24.3
quit
Francis Wright <francis.j.wright@gmail.com> writes:
> (with-no-warnings (byte-compile '(:foo)))
I think it should rather be like this (shows the same warning):
(byte-compile (lambda () (with-no-warnings (:foo))))
> produces the warning
>
> Warning: ‘:foo’ called as a function
Seems to have been the case at least as far back as 24.3, and probably
farther.
> Setting byte-compile-warnings to nil also does not suppress this
> warning. So either the documentation or the operation of both
> with-no-warnings and byte-compile-warnings is incorrect.
I think the warning is just missing a `byte-compile-warning-enabled-p'
check:
--- i/lisp/emacs-lisp/bytecomp.el
+++ w/lisp/emacs-lisp/bytecomp.el
@@ -3128,7 +3128,8 @@ byte-compile-form
(when (assq var byte-compile-lexical-variables)
(byte-compile-report-error
(format-message "%s cannot use lexical var `%s'" fn var))))))
- (when (macroexp--const-symbol-p fn)
+ (when (and (byte-compile-warning-enabled-p 'suspicious)
+ (macroexp--const-symbol-p fn))
(byte-compile-warn "`%s' called as a function" fn))
(when (and (byte-compile-warning-enabled-p 'interactive-only)
interactive-only)
> In fact, it seems a little inconsistent to me that none of
>
> (defun :foo ())
>
> (byte-compile ':foo)
>
> (:foo)
>
> produces any warning, but compiling the call of :foo does produce a
> warning.
Maybe (byte-compile (lambda () (defun :foo ()))) should give a warning,
though I don't see why the others should.
next prev parent reply other threads:[~2018-03-06 14:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-17 12:49 bug#30499: 26.0.91; Compiler warning cannot be suppressed Francis Wright
2018-03-06 14:06 ` Noam Postavsky [this message]
2018-03-11 2:08 ` Noam Postavsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y3j51ep7.fsf@gmail.com \
--to=npostavs@gmail.com \
--cc=30499@debbugs.gnu.org \
--cc=f.j.wright@live.co.uk \
--cc=francis.j.wright@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).