From: Juanma Barranquero <lekktu@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
Subject: Fixing some warnings in emacs-26
Date: Sat, 8 Jun 2019 07:11:01 +0200 [thread overview]
Message-ID: <CAAeL0SQ39+YZohvmY+QmWNEVGciheJ+xq6+YpmE6Y4PDMEzJVg@mail.gmail.com> (raw)
I'd like to propose these two patches for the emacs-26 release branch.
The first one fixes a real (if perhaps unlikely) buffer overflow in addpm.c.
The second one just adds a couple of defvars and marks some unused
args with _underscore to silence a few lexical warnings.
* nt/addpm.c (main): Fix buffer overflow
---
nt/addpm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nt/addpm.c b/nt/addpm.c
index f71ce5f238..5ef8079101 100644
--- a/nt/addpm.c
+++ b/nt/addpm.c
@@ -219,7 +219,7 @@ main (int argc, char *argv[])
{
int result;
- char msg[ MAX_PATH ];
+ char msg[ MAX_PATH + 20 ]; /* Needs extra space for fixed text. */
sprintf (msg, "Install Emacs at %s?\n", emacs_path);
result = MessageBox (NULL, msg, "Install Emacs",
MB_OKCANCEL | MB_ICONQUESTION);
--
2.21.0.windows.1
----------------------------------------------------
lisp/*.el: Fix some lexical warnings
* lisp/electric.el (electric-pair-text-pairs): Declare.
* lisp/url/url-auth.el (url-digest-auth-nonce-count):
Mark argument `nonce' as unused.
* lisp/ses.el (ses--edit-cell-completion-at-point-function)
(ses--read-printer-completion-at-point-function):
Mark argument `val' as unused.
* lisp/eshell/em-dirs.el (eshell-dirs-initialize, eshell/pwd):
Mark argument `args' as unused.
* lisp/term/ns-win.el (ns-version-string): Declare.
---
lisp/electric.el | 2 ++
lisp/eshell/em-dirs.el | 4 ++--
lisp/ses.el | 4 ++--
lisp/term/ns-win.el | 2 ++
lisp/url/url-auth.el | 2 +-
5 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/lisp/electric.el b/lisp/electric.el
index a30090d1d8..6eb516a0b9 100644
--- a/lisp/electric.el
+++ b/lisp/electric.el
@@ -461,6 +461,8 @@ electric-quote-inhibit-functions
after the inserted character. The functions in this hook should
not move point or change the current buffer.")
+(defvar electric-pair-text-pairs) ; from elec-pair.el
+
(defun electric-quote-post-self-insert-function ()
"Function that `electric-quote-mode' adds to `post-self-insert-hook'.
This requotes when a quoting key is typed."
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el
index 4d8debb954..f22c49dad5 100644
--- a/lisp/eshell/em-dirs.el
+++ b/lisp/eshell/em-dirs.el
@@ -207,7 +207,7 @@ eshell-dirs-initialize
(when eshell-cd-on-directory
(make-local-variable 'eshell-interpreter-alist)
(setq eshell-interpreter-alist
- (cons (cons #'(lambda (file args)
+ (cons (cons #'(lambda (file _args)
(eshell-lone-directory-p file))
'eshell-dirs-substitute-cd)
eshell-interpreter-alist)))
@@ -300,7 +300,7 @@ eshell-complete-user-reference
(file-name-as-directory (cdr user))))
eshell-user-names)))))))
-(defun eshell/pwd (&rest args)
+(defun eshell/pwd (&rest _args)
"Change output from `pwd' to be cleaner."
(let* ((path default-directory)
(len (length path)))
diff --git a/lisp/ses.el b/lisp/ses.el
index f3de00427b..095a20f829 100644
--- a/lisp/ses.el
+++ b/lisp/ses.el
@@ -2495,7 +2495,7 @@ ses--edit-cell-completion-at-point-function
prefix-length)
(when (and prefix (null (string= prefix "")))
(setq prefix-length (length prefix))
- (maphash (lambda (key val)
+ (maphash (lambda (key _val)
(let ((key-name (symbol-name key)))
(when (and (>= (length key-name) prefix-length)
(string= prefix (substring key-name 0
prefix-length)))
@@ -2648,7 +2648,7 @@ ses--read-printer-completion-at-point-function
prefix-length)
(when prefix
(setq prefix-length (length prefix))
- (maphash (lambda (key val)
+ (maphash (lambda (key _val)
(let ((key-name (symbol-name key)))
(when (and (>= (length key-name) prefix-length)
(string= prefix (substring key-name 0
prefix-length)))
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 40397fcfed..7f7a341f4a 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -739,6 +739,8 @@ ns-paste-secondary
;;;; macOS-like defaults for trackpad and mouse wheel scrolling on
;;;; macOS 10.7+.
+(defvar ns-version-string) ; nsfns.m
+
;; FIXME: This doesn't look right. Is there a better way to do this
;; that keeps customize happy?
(when (featurep 'cocoa)
diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el
index c3714f2656..9f1ca49a59 100644
--- a/lisp/url/url-auth.el
+++ b/lisp/url/url-auth.el
@@ -194,7 +194,7 @@ url-digest-auth-make-cnonce
(base64-encode-string
(apply 'format "%016x%04x%04x%05x%05x" (random) (current-time)) t))
-(defun url-digest-auth-nonce-count (nonce)
+(defun url-digest-auth-nonce-count (_nonce)
"The number requests sent to server with the given NONCE.
This count includes the request we're preparing here.
--
2.21.0.windows.1
next reply other threads:[~2019-06-08 5:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-08 5:11 Juanma Barranquero [this message]
2019-06-08 6:41 ` Fixing some warnings in emacs-26 Eli Zaretskii
2019-06-08 7:07 ` Juanma Barranquero
2019-06-08 8:43 ` Eli Zaretskii
2019-06-08 22:55 ` Juanma Barranquero
2019-06-09 6:12 ` Eli Zaretskii
2019-06-08 8:22 ` Andreas Schwab
2019-06-08 8:51 ` Eli Zaretskii
2019-06-09 11:02 ` Juanma Barranquero
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAAeL0SQ39+YZohvmY+QmWNEVGciheJ+xq6+YpmE6Y4PDMEzJVg@mail.gmail.com \
--to=lekktu@gmail.com \
--cc=emacs-devel@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.