(byte-compile-normal-call): Warn when `mapcar' is called for effect.
+2007-09-21 Markus Triska <markus.triska@gmx.at>
+
+ * emacs-lisp/bytecomp.el (byte-compile-normal-call): Warn when
+ `mapcar' is called for effect.
+
2007-09-21 Glenn Morris <rgm@gnu.org>
* obsolete/sun-fns.el (emacs-quit-menu): Remove emacstool-related code.
(defun byte-compile-normal-call (form)
(if byte-compile-generate-call-tree
(byte-compile-annotate-call-tree form))
+ (when (and for-effect (eq (car form) 'mapcar))
+ (byte-compile-set-symbol-position 'mapcar)
+ (byte-compile-warn
+ "`mapcar' called for effect; use `mapc' or `dolist' instead"))
(byte-compile-push-constant (car form))
(mapc 'byte-compile-form (cdr form)) ; wasteful, but faster.
(byte-compile-out 'byte-call (length (cdr form))))