diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2023-05-11 19:24:51 +0200 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2023-05-13 11:53:25 +0200 |
commit | bfc07100d28d0f687da0a1dd5fdfa42a92a93f88 (patch) | |
tree | 4ca024cacb42464e68c51f07bbbae3d1fe9af4eb /test/lisp/emacs-lisp/rx-tests.el | |
parent | fa598571adab4858282f337b45984517e197f8a9 (diff) | |
download | emacs-bfc07100d28d0f687da0a1dd5fdfa42a92a93f88.tar.gz emacs-bfc07100d28d0f687da0a1dd5fdfa42a92a93f88.tar.bz2 emacs-bfc07100d28d0f687da0a1dd5fdfa42a92a93f88.zip |
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.
Diffstat (limited to 'test/lisp/emacs-lisp/rx-tests.el')
0 files changed, 0 insertions, 0 deletions