From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Fixing some warnings in emacs-26 Date: Sat, 8 Jun 2019 07:11:01 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="258871"; mail-complaints-to="usenet@blaine.gmane.org" To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 08 07:12:30 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hZTeS-00159g-VW for ged-emacs-devel@m.gmane.org; Sat, 08 Jun 2019 07:12:25 +0200 Original-Received: from localhost ([::1]:55088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZTeR-0000zx-Bi for ged-emacs-devel@m.gmane.org; Sat, 08 Jun 2019 01:12:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54319) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZTdk-0000ys-BH for emacs-devel@gnu.org; Sat, 08 Jun 2019 01:11:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZTdj-0003ZK-4O for emacs-devel@gnu.org; Sat, 08 Jun 2019 01:11:40 -0400 Original-Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]:35322) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hZTdj-0003Yv-0e for emacs-devel@gnu.org; Sat, 08 Jun 2019 01:11:39 -0400 Original-Received: by mail-qk1-x72b.google.com with SMTP id l128so2615357qke.2 for ; Fri, 07 Jun 2019 22:11:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=OSoSPrLBEjQNEghjpSf10eSw8pEyEmjxEwLo6D0gtls=; b=ZG2wMvH+7n4xZNs7Fp2JBW4lTcaibT4+PhZpO089QVJbcPmdSj0B03/lBBmJq7/U8/ VW0XEFinhVFM1tcUmaZmKVpO7Q1Oizb/+lUMdpOSfYduMZ9Zyny/jepQPArTUbKBvElG HQ5NJuNOaqoC25DLLbaC12WY8BNL7qmyxEALUOtc8dQnyS2+r8b85diRAcHNcJHNM/sZ 9Hpq0SHoYoA6+cqxaMue/ekiZn8OIk8KeizBplgM3ZXUrVoABkHWY87+vgBZ89bWotlB b+o01I8RvDnz7KNaH2AM9gk86XZStEoYukA6oRCxfP+n6Gts3hzqD4QEdTdCbHtZLSQz xiiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=OSoSPrLBEjQNEghjpSf10eSw8pEyEmjxEwLo6D0gtls=; b=AAsqUBVncU3UyVZJXBDST0/bqu/0wMy0MFo3yRBBFGEMU0Fn0sAR3JAy1k6+BWMo1M 8RSgk3OGE8RMb2gniLj0B0NIBqCXrtTngc9C/bGCN5ljllAQmQoyjI9CCOj2RXU8fqfv rDxAbydjkb3dkAgeuWpgZk1r2ZHzcpUnJVwTjJ+qdPZH6bfy8HD6d7lgYwtBzo44gCOY s8o+vyhJ77e2EWbtrXRqoGnP/k8H2umK51eRltOfgEPusdtsI96SB5pqeBfxvryZNyb8 p7oGjSP1or1yuO4WgSHV762gK8N67WPH1AJatRnOmWzsrMt3hVQRUrC18DVxkXbNoYmz eQMA== X-Gm-Message-State: APjAAAUdZgd07QKEM6LDFN9pnqmay+ej9ewLKj+CBGCyyMcr167BaT+5 mPpIQjOJ3xjVVnUpLFWMehgLkSBCpZH1ALGGMEHRIsLLvc8= X-Google-Smtp-Source: APXvYqzKLjYGxlvIbywpekt52TQdGO7vT2jibFhun09/99meWpHN0+VC9EZHVFQEyinfviKHSQbuQvwcvfrBZuKFLBU= X-Received: by 2002:a05:620a:119a:: with SMTP id b26mr27656714qkk.332.1559970697857; Fri, 07 Jun 2019 22:11:37 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::72b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:237320 Archived-At: 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