From: Alan Mackenzie Date: Mon, 23 Nov 2015 14:25:15 +0000 (+0000) Subject: Issue a warning from the byte compiler on a malformed `setq' form. X-Git-Tag: emacs-25.0.90~687 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c89b5a0f8a3905c023eb196e453383c95a4f6a89;p=emacs.git Issue a warning from the byte compiler on a malformed `setq' form. Partly fixes bug#20241. * lisp/emacs-lisp/bytecomp.el (byte-compile-setq): Issue a warning when a `setq' form with an odd number of arguments is compiled. --- diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 024719168af..fc3bfc5fc51 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3713,7 +3713,11 @@ discarding." (let ((args (cdr form))) (if args (while args - (byte-compile-form (car (cdr args))) + (if (eq (length args) 1) + (byte-compile-warn + "missing value for `%S' at end of setq" + (car args))) + (byte-compile-form (car (cdr args))) (or byte-compile--for-effect (cdr (cdr args)) (byte-compile-out 'byte-dup 0)) (byte-compile-variable-set (car args))