From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <743DF3D0-DA0F-49D4-A780-02C698AE8EFB@acm.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33006"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 12299@debbugs.gnu.org, Lars Ingebrigtsen , Roland Winkler To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 23 17:03:15 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6whn-0008Mh-5F for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Jul 2021 17:03:15 +0200 Original-Received: from localhost ([::1]:48740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6whl-0008VD-Vj for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Jul 2021 11:03:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6wha-0008V5-PI for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2021 11:03:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60970) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6wha-0002cQ-Hu for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2021 11:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m6wha-0003gG-Fn for bug-gnu-emacs@gnu.org; Fri, 23 Jul 2021 11:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Jul 2021 15:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12299 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 12299-submit@debbugs.gnu.org id=B12299.162705257014130 (code B ref 12299); Fri, 23 Jul 2021 15:03:02 +0000 Original-Received: (at 12299) by debbugs.gnu.org; 23 Jul 2021 15:02:50 +0000 Original-Received: from localhost ([127.0.0.1]:44283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6whN-0003fq-UU for submit@debbugs.gnu.org; Fri, 23 Jul 2021 11:02:50 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:64789) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m6whJ-0003fa-I4 for 12299@debbugs.gnu.org; Fri, 23 Jul 2021 11:02:48 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id AA00A440FB3; Fri, 23 Jul 2021 11:02:39 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 6A166440FA3; Fri, 23 Jul 2021 11:02:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1627052558; bh=adxI8p8fmwhqwIA4keQn9GTjR1kGOkd/xcbbm8WqhX4=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=F9z/hH5/sADf3JoFoKzCmId73qgaccLchbNuCHAGWibQwvVK65lR7MtMFurudS0Q6 eDBUxrcxRkrZrEBqf+uhb1JHDlesxOZ1bXO4sr2U1bQ7darH9pKGdqFeVKNAzEIm22 7BztTCRYTVIkJL0sFjZbzplOoiol38JGD2k+brIDmp/94zfBBaMxwElQm44u1HRZ3v 7kC6EDHuRjvVx5+jK95jDBpfsVHRROaBWiOAOKeiISm2LGhEWws3LIH5DtC9sP6wwn TO1CgGCLjhCg6aJBaIHU69L9H19OsJTP3L6VR21mJvG2luoqGpLUSmbdXD+K9EIn3e F03TTcpGPTatg== Original-Received: from alfajor (unknown [216.154.29.138]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 33BF4120281; Fri, 23 Jul 2021 11:02:38 -0400 (EDT) In-Reply-To: <743DF3D0-DA0F-49D4-A780-02C698AE8EFB@acm.org> ("Mattias =?UTF-8?Q?Engdeg=C3=A5rd?="'s message of "Thu, 22 Jul 2021 15:14:55 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:210592 Archived-At: > 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