[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#12299: 24.1; no byte compiler warning for inline function call with
From: |
Stefan Monnier |
Subject: |
bug#12299: 24.1; no byte compiler warning for inline function call with too few arguments [PATCH] |
Date: |
Fri, 23 Jul 2021 11:02:37 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
> index 341643c7d1..ad9f827171 100644
> --- a/lisp/emacs-lisp/byte-opt.el
> +++ b/lisp/emacs-lisp/byte-opt.el
> @@ -274,6 +274,7 @@ byte-compile-inline-expand
> ((pred byte-code-function-p)
> ;; (message "Inlining byte-code for %S!" name)
> ;; The byte-code will be really inlined in byte-compile-unfold-bcf.
> + (byte-compile--check-arity-bytecode form fn)
> `(,fn ,@(cdr form)))
Hmm... wouldn't we want the warning to be emitted if the source code was itself
of the form constructed by `(,fn ,@(cdr form))?
IOW I think we want that `byte-compile--check-arity-bytecode` call to be
elsewhere (in the code that actually compiles the code constructed by
`(,fn ,@(cdr form))).
Also, as a general rule I think we should try and refrain from emitting
warnings from the code in byte-opt.el (warnings should be independent
from optimizations).
> - `(,(symbol-function name) ,@(cdr form))))
> + (let ((bc (symbol-function name)))
> + (byte-compile--check-arity-bytecode form bc)
> + `(,bc ,@(cdr form)))))
I think the same holds here.
Stefan