From unknown Wed Jun 18 00:19:29 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#20457 <20457@debbugs.gnu.org> To: bug#20457 <20457@debbugs.gnu.org> Subject: Status: compiler does not warn about arglist mismatch with obsolete alias Reply-To: bug#20457 <20457@debbugs.gnu.org> Date: Wed, 18 Jun 2025 07:19:29 +0000 retitle 20457 compiler does not warn about arglist mismatch with obsolete a= lias reassign 20457 emacs submitter 20457 Glenn Morris severity 20457 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 29 03:08:18 2015 Received: (at submit) by debbugs.gnu.org; 29 Apr 2015 07:08:18 +0000 Received: from localhost ([127.0.0.1]:55483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YnM6U-0007xS-9W for submit@debbugs.gnu.org; Wed, 29 Apr 2015 03:08:18 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:35277 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YnM6S-0007xK-Df for submit@debbugs.gnu.org; Wed, 29 Apr 2015 03:08:16 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1YnM6R-0002Z4-Co; Wed, 29 Apr 2015 03:08:15 -0400 From: Glenn Morris To: submit@debbugs.gnu.org Subject: compiler does not warn about arglist mismatch with obsolete alias X-Spook: bootleg NWO arrangements SP4 fissionable AK-47 Echelon RSA X-Ran: 7[XUc)>HCGmrj+pR#zb(m{6}4K)9b^.]Aj*J#%jpH~YE\p6y(YX)Kr04~+LtSr5?SM|fc^ X-Hue: magenta X-Debbugs-No-Ack: yes X-Attribution: GM Date: Wed, 29 Apr 2015 03:08:15 -0400 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Package: emacs Version: 24.5 Byte-compiling the following: (defun newfunc () t) (eval-and-compile (define-obsolete-function-alias 'oldfunc 'newfunc "25.1")) (defun blah () (oldfunc t)) warns about oldfunc being obsolete: In blah: foo.el:6:8:Warning: `oldfunc' is an obsolete function (as of 25.1); use `newfunc' instead. however, it says nothing about blah calling oldfunc with the wrong number of arguments, which leads to a runtime error. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 08 00:56:17 2016 Received: (at 20457) by debbugs.gnu.org; 8 Apr 2016 04:56:17 +0000 Received: from localhost ([127.0.0.1]:53374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aoOSv-0005UF-Dg for submit@debbugs.gnu.org; Fri, 08 Apr 2016 00:56:17 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:59305) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aoOSt-0005U6-3B for 20457@debbugs.gnu.org; Fri, 08 Apr 2016 00:56:15 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id E8F60A9FD9B; Fri, 8 Apr 2016 06:56:11 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CWxPpswPriYi; Fri, 8 Apr 2016 06:56:08 +0200 (CEST) Received: from localhost (98-171.echostar.pl [213.156.98.171]) by mail.mojserwer.eu (Postfix) with ESMTPSA id BDE49A9FD98; Fri, 8 Apr 2016 06:56:08 +0200 (CEST) From: Marcin Borkowski To: Glenn Morris Subject: Re: bug#20457: compiler does not warn about arglist mismatch with obsolete alias References: Date: Fri, 08 Apr 2016 06:56:01 +0200 In-Reply-To: (Glenn Morris's message of "Wed, 29 Apr 2015 03:08:15 -0400") Message-ID: <87vb3spula.fsf@mbork.pl> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 20457 Cc: 20457@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2015-04-29, at 03:08, Glenn Morris wrote: > Package: emacs > Version: 24.5 > > Byte-compiling the following: > > (defun newfunc () > t) > > (eval-and-compile > (define-obsolete-function-alias 'oldfunc 'newfunc "25.1")) > > (defun blah () > (oldfunc t)) > > warns about oldfunc being obsolete: > > In blah: > foo.el:6:8:Warning: `oldfunc' is an obsolete function (as of 25.1); use > `newfunc' instead. > > however, it says nothing about blah calling oldfunc with the wrong > number of arguments, which leads to a runtime error. Confirmed on GNU Emacs 25.1.50.8 (1e8cd05). Best, -- Marcin From debbugs-submit-bounces@debbugs.gnu.org Thu May 27 20:30:48 2021 Received: (at 20457) by debbugs.gnu.org; 28 May 2021 00:30:48 +0000 Received: from localhost ([127.0.0.1]:53145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmQOm-0002ob-8E for submit@debbugs.gnu.org; Thu, 27 May 2021 20:30:48 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48420) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmQOl-0002jJ-4M for 20457@debbugs.gnu.org; Thu, 27 May 2021 20:30:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=3rkZdg0KDepYHDuW1UvqMBpQiae9niJnbFl+l1fOyHo=; b=OEQpD+Y9Gk82NBoiyale7k3JN4 oVFAIqdLuu5VWnqofuW72AkIgLDDX2rVbP26IZj7OVBzsffaS5sPt+x7K+IEu5+VNQpvXfWnDy66C t7snUvtvx+U8yddx94bVCXX2gwmt07hKVHM6l5mwGi9P5XKoV3V0cAF3gaQEyzH3SwnE=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lmQOc-0002Nz-SF; Fri, 28 May 2021 02:30:41 +0200 From: Lars Ingebrigtsen To: Glenn Morris Subject: Re: bug#20457: compiler does not warn about arglist mismatch with obsolete alias References: X-Now-Playing: The Residents's _The King & Eye: RMX_: "A Fool such as I" Date: Fri, 28 May 2021 02:30:38 +0200 In-Reply-To: (Glenn Morris's message of "Wed, 29 Apr 2015 03:08:15 -0400") Message-ID: <871r9r3djl.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Glenn Morris writes: > warns about oldfunc being obsolete: > > In blah: > foo.el:6:8:Warning: `oldfunc' is an obsolete function (as of 25.1); use > `newfunc' instead. > > however, it says nothing about blah calling oldfun [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20457 Cc: 20457@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Glenn Morris writes: > warns about oldfunc being obsolete: > > In blah: > foo.el:6:8:Warning: `oldfunc' is an obsolete function (as of 25.1); use > `newfunc' instead. > > however, it says nothing about blah calling oldfunc with the wrong > number of arguments, which leads to a runtime error. The problem seems to be more general than that -- it doesn't warn about the wrong number of arguments, ever, if using aliases? Test case: (defun foo ()) (defalias 'bar 'foo) (defun zot () (bar t)) (defun foobar () (foo t)) ---- Compiling file /tmp/warn.el at Fri May 28 02:26:55 2021 In foobar: warn.el:6:4: Warning: foo called with 1 argument, but accepts only 0 ---- Note -- no warning from the zot function. It seems so odd that nobody has pointed this out before, so I'm wondering if I'm just doing something obviously wrong in this test case. Anybody? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri May 28 02:26:45 2021 Received: (at 20457) by debbugs.gnu.org; 28 May 2021 06:26:45 +0000 Received: from localhost ([127.0.0.1]:53485 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmVxF-0001OF-Dn for submit@debbugs.gnu.org; Fri, 28 May 2021 02:26:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmVxD-0001O1-To for 20457@debbugs.gnu.org; Fri, 28 May 2021 02:26:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48830) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmVx8-0001MT-8P; Fri, 28 May 2021 02:26:38 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3290 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmVx3-0004uj-90; Fri, 28 May 2021 02:26:34 -0400 Date: Fri, 28 May 2021 09:26:39 +0300 Message-Id: <83cztb8jc0.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen , Stefan Monnier In-Reply-To: <871r9r3djl.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri, 28 May 2021 02:30:38 +0200) Subject: Re: bug#20457: compiler does not warn about arglist mismatch with obsolete alias References: <871r9r3djl.fsf@gnus.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20457 Cc: rgm@gnu.org, 20457@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Date: Fri, 28 May 2021 02:30:38 +0200 > Cc: 20457@debbugs.gnu.org > > Glenn Morris writes: > > > warns about oldfunc being obsolete: > > > > In blah: > > foo.el:6:8:Warning: `oldfunc' is an obsolete function (as of 25.1); use > > `newfunc' instead. > > > > however, it says nothing about blah calling oldfunc with the wrong > > number of arguments, which leads to a runtime error. > > The problem seems to be more general than that -- it doesn't warn about > the wrong number of arguments, ever, if using aliases? > > Test case: > > (defun foo ()) > (defalias 'bar 'foo) > (defun zot () > (bar t)) > (defun foobar () > (foo t)) > > > ---- > Compiling file /tmp/warn.el at Fri May 28 02:26:55 2021 > > In foobar: > warn.el:6:4: Warning: foo called with 1 argument, but accepts only 0 > ---- > > Note -- no warning from the zot function. > > It seems so odd that nobody has pointed this out before, so I'm > wondering if I'm just doing something obviously wrong in this test > case. Anybody? Stefan? From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 05 11:54:49 2021 Received: (at 20457) by debbugs.gnu.org; 5 Jun 2021 15:54:49 +0000 Received: from localhost ([127.0.0.1]:49933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpYdM-0007id-UD for submit@debbugs.gnu.org; Sat, 05 Jun 2021 11:54:49 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:45350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpYdH-0007iN-7A for 20457@debbugs.gnu.org; Sat, 05 Jun 2021 11:54:47 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 8A9634411E0; Sat, 5 Jun 2021 11:54:37 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5B8FD440FDD; Sat, 5 Jun 2021 11:54:36 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1622908476; bh=Bi+B9ANYlmLMRSBk0PyjgnIBY8DwhngBhUcD1QTJwic=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ILV01BXEJXr9tG3n4kXCDLMoigNiAUmMhZ/Xgmon/QN8oJJUWqsv0M7QW9evvjyHq udaFauhgeLzEFhZgdYlocnVbA0a0BJVDEZenaqn5SvCNu+ovFILpuMTOy//7a3f8yQ DzN5hjb3f6lUgtQ2dOsRZzCq++a7TNW/nr6y0JUHhFhQZN7QcEP6RQJrM1AGRRiHab K5aqMGu5wxfsPHo1TlEy/lvyANxwrufWM+YIXWUbrr1AzU09TDOXTYY824n+Pe32Jr AJz7LUwiOtMvIJS6HM1DIdZPBdLJ0SAbtBvhWa0AuK+em29zN51OgJbFI5wkRNsRT+ rKQHgNR9xn3BQ== Received: from alfajor (69-196-163-239.dsl.teksavvy.com [69.196.163.239]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 230741207C6; Sat, 5 Jun 2021 11:54:36 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#20457: compiler does not warn about arglist mismatch with obsolete alias Message-ID: References: <871r9r3djl.fsf@gnus.org> <83cztb8jc0.fsf@gnu.org> Date: Sat, 05 Jun 2021 11:54:35 -0400 In-Reply-To: <83cztb8jc0.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 28 May 2021 09:26:39 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.039 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20457 Cc: rgm@gnu.org, Lars Ingebrigtsen , 20457@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> The problem seems to be more general than that -- it doesn't warn about >> the wrong number of arguments, ever, if using aliases? >> >> Test case: >> >> (defun foo ()) >> (defalias 'bar 'foo) >> (defun zot () >> (bar t)) >> (defun foobar () >> (foo t)) >> >> >> ---- >> Compiling file /tmp/warn.el at Fri May 28 02:26:55 2021 >> >> In foobar: >> warn.el:6:4: Warning: foo called with 1 argument, but accepts only 0 >> ---- >> >> Note -- no warning from the zot function. >> >> It seems so odd that nobody has pointed this out before, so I'm >> wondering if I'm just doing something obviously wrong in this test >> case. Anybody? > > Stefan? The byte-compiler's tracking of functions arity is quite limited, yes. Patches to improve it are welcome. Stefan