GNU bug report logs - #20457
compiler does not warn about arglist mismatch with obsolete alias

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Wed, 29 Apr 2015 07:09:01 UTC

Severity: normal

Found in version 24.5

Full log


Message #15 received at 20457 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: rgm <at> gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>, 20457 <at> debbugs.gnu.org
Subject: Re: bug#20457: compiler does not warn about arglist mismatch with
 obsolete alias
Date: Sat, 05 Jun 2021 11:54:35 -0400
>> 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





This bug report was last modified 4 years and 11 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.