[AC21.5R21.4] byte-compiler warnings

Jerry James james at xemacs.org
Fri Aug 13 17:18:32 EDT 2004


APPROVE COMMIT 21.5 RECOMMEND 21.4

jan at rychter.com wrote:
> It's a minor thing, but I have noticed that the byte compiler produces a
> bogus warning. Compiling this:
>
>   (defun foo ()
>     (forward-word))
>
> Produces:
>
>   Compiling file /home/jwr/bctest.el at Fri Aug 13 11:05:16 2004
>   While compiling foo:
>     ** forward-word called with 0 args, but requires 1-2
>
> ... which seems to be wrong, because forward-word has optional
> arguments:
>
>   (forward-word &optional COUNT BUFFER)

Oh, good catch!  It's kind of frightening that we declare a bunch of
functions in C, then tell the byte compiler how many args they have
elsewhere.  We should be able to extract this information automatically.

lisp/ChangeLog addition:

2004-08-13  Jerry James  <james at xemacs.org>

	* bytecomp.el (forward-word): Tell the byte compiler the correct
	number of arguments to forward-word.


xemacs-21.5 source patch:
Diff command:   cvs -q diff -uN
Files affected: lisp/bytecomp.el

Index: lisp/bytecomp.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/bytecomp.el,v
retrieving revision 1.18
diff -d -u -u -r1.18 bytecomp.el
--- lisp/bytecomp.el	2003/09/09 13:37:19	1.18
+++ lisp/bytecomp.el	2004/08/13 21:11:40
@@ -2956,7 +2956,7 @@
 (byte-defop-compiler char-after		0-1+1)
 (byte-defop-compiler set-buffer		1)
 ;;(byte-defop-compiler set-mark		1) ;; obsolete
-(byte-defop-compiler forward-word	1+1)
+(byte-defop-compiler forward-word	0-1+1)
 (byte-defop-compiler char-syntax	1+1)
 (byte-defop-compiler nreverse		1)
 (byte-defop-compiler car-safe		1)

-- 
Jerry James
http://www.ittc.ku.edu/~james/




More information about the XEmacs-Beta mailing list