]> git.eshelyaron.com Git - emacs.git/commitdiff
Issue a warning from the byte compiler on a malformed `setq' form.
authorAlan Mackenzie <acm@muc.de>
Mon, 23 Nov 2015 14:25:15 +0000 (14:25 +0000)
committerAlan Mackenzie <acm@muc.de>
Mon, 23 Nov 2015 14:25:15 +0000 (14:25 +0000)
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.

lisp/emacs-lisp/bytecomp.el

index 024719168af5e2d10ed6b631c0fb6ae1094d39ff..fc3bfc5fc513a75cf2e18080d047f1775eba8038 100644 (file)
@@ -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))