unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: 34117@debbugs.gnu.org
Subject: bug#34117: 26.1; Incorrect byte-compile warnings
Date: Thu, 17 Jan 2019 11:31:16 -0800 (PST)	[thread overview]
Message-ID: <172346c1-8bd6-4b26-b55f-acc83aede737@default> (raw)

Byte-compiling a sexp such as this:

 (make-obsolete-variable 'foo 'bar)

raises a warning such as this:

 Warning: make-obsolete-variable called with 2 arguments, but requires
 3-4

That's wrong.  It is incorrect that it requires 3 or 4.  It requires
only 2.

The code for `make-obsolete-variable' has this comment, which betrays
the probable (misguided) motivation for the warning:

 "New code should always provide the `when' argument."

New code?  This comment, and the resulting warning, seem to be targeted
at core Emacs developers, not users.

"Require" means require.  This function does NOT require 3 or 4 args.

It is important for backward compatibility that requier only 2 args.  It
might be desirable for users, as well as core Emacs developers, to use 3
or 4 args, but neither the 3rd nor the 4th should be required (and
neither IS required).  The warning should be removed - there is nothing
to warn about.

There are ways to _encourage_ users to add a third arg (WHEN).  Warning
them that it is _required_ is not appropriate.  The byte-compiler should
not lie.

Same misguided approach to `make-obsolete'.  Only 2 args are required.
It is inappropriate, misleading, and unnecessary to tell users that 3
are required.


In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
 of 2018-05-30
Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea
Windowing system distributor `Microsoft Corp.', version 10.0.17134
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''





             reply	other threads:[~2019-01-17 19:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17 19:31 Drew Adams [this message]
2019-01-17 22:20 ` bug#34117: 26.1; Incorrect byte-compile warnings Glenn Morris
2019-01-18  0:46   ` Drew Adams
2019-01-18  8:39     ` Eli Zaretskii

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=172346c1-8bd6-4b26-b55f-acc83aede737@default \
    --to=drew.adams@oracle.com \
    --cc=34117@debbugs.gnu.org \
    /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).