diff options
author | Alan Mackenzie <acm@muc.de> | 2015-11-23 14:25:15 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2015-11-23 14:25:15 +0000 |
commit | c89b5a0f8a3905c023eb196e453383c95a4f6a89 (patch) | |
tree | 9fb85636eda6c5cd501a6e1cd69117b17736c1d7 /lisp/emacs-lisp/bytecomp.el | |
parent | 74e5d4e21e7206693ce6ce999e884d75230ad33b (diff) | |
download | emacs-c89b5a0f8a3905c023eb196e453383c95a4f6a89.tar.gz emacs-c89b5a0f8a3905c023eb196e453383c95a4f6a89.tar.bz2 emacs-c89b5a0f8a3905c023eb196e453383c95a4f6a89.zip |
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.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 6 |
1 files changed, 5 insertions, 1 deletions
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)) |