emacs/test/lisp/emacs-lisp
Mattias Engdegård bfc07100d2 Byte-compiler warning about mutation of constant values
When we can easily detect mutation of constants (quoted lists, strings
and vectors), warn.  For example,

  (setcdr '(1 . 2) 3)
  (nreverse [1 2 3])
  (put-text-property 0 3 'face 'highlight "moo")

Such code can result in surprising behaviour and problems that
are difficult to debug.

* lisp/emacs-lisp/bytecomp.el (byte-compile-form, mutating-fns):
Add the warning and a list of functions to warn about.
* etc/NEWS: Announce.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings): Add test cases.
2023-05-13 11:53:25 +02:00
..
bytecomp-resources Don't rewrite set to setq of lexical variables 2022-09-22 14:54:15 +02:00
edebug-resources ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
eieio-tests ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
faceup-resources ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
faceup-tests ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
macroexp-resources ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
package-resources ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
pp-resources Fix pp-emacs-lisp-code printing of cons cells 2022-05-17 19:45:20 +02:00
shadow-resources Use lexical-binding in most remaining emacs-lisp tests 2020-04-30 12:09:51 +02:00
testcover-resources ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
backquote-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
backtrace-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
benchmark-tests.el Skip failing tests on Cygwin with native compilation (bug#62450) 2023-03-26 10:04:59 -04:00
bindat-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
bytecomp-tests.el Byte-compiler warning about mutation of constant values 2023-05-13 11:53:25 +02:00
cconv-tests.el Don't modify interactive closures destructively (Bug#60974). 2023-03-06 20:28:20 +05:30
check-declare-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
checkdoc-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
cl-extra-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
cl-generic-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
cl-lib-tests.el Make old-struct test more robust 2023-05-05 22:00:28 +02:00
cl-macs-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
cl-preloaded-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
cl-print-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
cl-seq-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
comp-cstr-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
comp-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
copyright-tests.el ; * test/lisp/emacs-lisp/copyright-tests.el: Fix and future-safe. 2023-01-01 13:18:50 +01:00
derived-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
easy-mmode-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
edebug-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
ert-tests.el Remove useless unwind-protect forms, or make them useful as intended 2023-04-07 19:08:33 +02:00
ert-x-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
find-func-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
float-sup-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
generator-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
gv-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
hierarchy-tests.el Fix failing test for package Hierarchy 2022-10-28 10:33:18 +03:00
icons-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
let-alist-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
lisp-mnt-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
lisp-mode-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
lisp-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
macroexp-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
map-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
memory-report-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
multisession-tests.el Merge from origin/emacs-29 2023-01-01 05:47:47 -05:00
nadvice-tests.el Pacify byte-compiler warnings in nadvice-tests 2023-04-09 19:03:10 +01:00
oclosure-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
package-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
pcase-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
pp-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
range-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
regexp-opt-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
ring-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
rmc-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
rx-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
seq-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
shadow-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
shortdoc-tests.el Fix shortdoc-tests when Unicode arrows can be displayed 2023-03-25 17:43:43 +01:00
subr-x-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
syntax-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
tabulated-list-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
testcover-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
text-property-search-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
thunk-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
timer-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
unsafep-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
vtable-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
warnings-tests.el ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00