unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#30499: 26.0.91; Compiler warning cannot be suppressed
@ 2018-02-17 12:49 Francis Wright
  2018-03-06 14:06 ` Noam Postavsky
  2018-03-11  2:08 ` Noam Postavsky
  0 siblings, 2 replies; 3+ messages in thread
From: Francis Wright @ 2018-02-17 12:49 UTC (permalink / raw)
  To: 30499


(with-no-warnings (byte-compile '(:foo)))

produces the warning

Warning: ‘:foo’ called as a function

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.

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.


In GNU Emacs 26.0.91 (build 1, x86_64-w64-mingw32)
 of 2018-01-23 built on MONOLITH
Windowing system distributor 'Microsoft Corp.', version 10.0.16299
Recent messages:
Type C-x 1 to delete the help window.
Complete, but not unique
Making completion list...
Complete, but not unique

Making completion list... [2 times]
Mark set [5 times]
Making completion list...
Type C-x 1 to delete the help window.
Type "q" in help window to restore its previous buffer.

Configured using:
 'configure --prefix=/d/emacs/emacs-26.0.91 --without-imagemagick
 --without-dbus'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS LCMS2

Important settings:
  value of $LANG: ENG
  locale-coding-system: cp1252

Major mode: Lisp Interaction

Minor modes in effect:
  flyspell-mode: t
  shell-dirtrack-mode: t
  show-paren-mode: t
  delete-selection-mode: t
  electric-pair-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  horizontal-scroll-bar-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mail-utils warnings cl-extra compile eieio-opt speedbar sb-image ezimage
dframe find-func help-fns radix-tree help-mode cl-print debug flyspell
ispell imenu tramp tramp-compat tramp-loaddefs trampver ucs-normalize
shell pcomplete comint ansi-color ring parse-time format-spec advice
paren delsel cus-start cus-load finder-inf info package easymenu
epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib elec-pair server time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type 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 elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame 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 charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote w32notify w32 lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 258989 13496)
 (symbols 56 25373 1)
 (miscs 48 138 312)
 (strings 32 46389 1599)
 (string-bytes 1 1286336)
 (vectors 16 41749)
 (vector-slots 8 788352 12686)
 (floats 8 86 527)
 (intervals 56 584 25)
 (buffers 992 17))





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

* bug#30499: 26.0.91; Compiler warning cannot be suppressed
  2018-02-17 12:49 bug#30499: 26.0.91; Compiler warning cannot be suppressed Francis Wright
@ 2018-03-06 14:06 ` Noam Postavsky
  2018-03-11  2:08 ` Noam Postavsky
  1 sibling, 0 replies; 3+ messages in thread
From: Noam Postavsky @ 2018-03-06 14:06 UTC (permalink / raw)
  To: Francis Wright; +Cc: 30499, f.j.wright

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.





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

* bug#30499: 26.0.91; Compiler warning cannot be suppressed
  2018-02-17 12:49 bug#30499: 26.0.91; Compiler warning cannot be suppressed Francis Wright
  2018-03-06 14:06 ` Noam Postavsky
@ 2018-03-11  2:08 ` Noam Postavsky
  1 sibling, 0 replies; 3+ messages in thread
From: Noam Postavsky @ 2018-03-11  2:08 UTC (permalink / raw)
  To: 30499; +Cc: Francis Wright

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

tags 30499 fixed
close 30499 27.1
quit


[-- Attachment #2: Type: message/rfc822, Size: 437 bytes --]

From: Francis Wright <francis.j.wright@gmail.com>
To: Noam Postavsky <npostavs@gmail.com>
Subject: Re: bug#30499: 26.0.91; Compiler warning cannot be suppressed
Date: Thu, 8 Mar 2018 16:26:11 +0000
Message-ID: <CALWipcA5WHHmO2u7PviZNyBAFwF+Tc4EteAhUNd8zBA1SEo79Q@mail.gmail.com>

Thanks!

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



I pushed the fix to master.

[1: fda58fbc24]: 2018-03-10 19:51:25 -0500
  Fix wrong behavior of 'outline-headers-as-kill' command (Bug#30209)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=fda58fbc245a3f6f6722261ffb2e2262231bd4ea

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

end of thread, other threads:[~2018-03-11  2:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-17 12:49 bug#30499: 26.0.91; Compiler warning cannot be suppressed Francis Wright
2018-03-06 14:06 ` Noam Postavsky
2018-03-11  2:08 ` Noam Postavsky

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).