The compiler sometimes prints out an annoying (and incorrect)
warning that callers of functions are passing the wrong number of
arguments.  This happens when the called function has been redefined
to take a different number of arguments.  The compiler lets the function
be redefined, but seems to hold on to the old information about how many
arguments it has and complains when any callers are subsequently recompiled
using the new (correct) number of arguments.

I'm running with cmucl-18e on linux.

----------------------------------

1. compile function

(defun fun1 (x)
  (+ x 3))

;;; Compiling defun fun1
; Converted FUN1.
; Compiling LAMBDA NIL:
; Compiling Top-Level Form:

----------------------------------

2. compile again, changing arguments
(defun fun1 (x y)
  (+ x y))

* ;;; Compiling defun fun1
; Converted FUN1.
; Compiling LAMBDA NIL:
; Compiling Top-Level Form:

----------------------------------

3. compile a caller
(defun fun2 ()
  (fun1 3 2))

;;; Compiling defun fun2
; In: DEFUN FUN2

;   (FUN1 3 2)
; Warning: Function called with two arguments, but wants exactly one.
;
; Converted FUN2.
; Compiling LAMBDA NIL:
; Compiling Top-Level Form:

; Compilation unit finished.
;   1 warning



Reply via email to