From fe6eee573ccc4a4033d80a996b3a1f07f6e4b86d Mon Sep 17 00:00:00 2001 From: pw <pw> Date: Sat, 27 Jan 2001 15:07:45 +0000 Subject: [PATCH] Silence compiler warnings about undefined function <hairy-make-instance-name> when compiling a method containing a make-instance call. Test case: ~~~~~~~~~~~~~~~~~~~~~~~~~ (defclass some-class () ((slot :initarg :slot))) ;; This generates compiler warnings about unknown function ;; Warning: Undefined function: ;; PCL::|MAKE-INSTANCE COMMON-LISP-USER::SOME-CLASS (:SLOT) NIL| ;; which goes away once the form is loaded. (defmethod fooey (x) (declare (ignore x) #+nil (optimize (inhibit-warnings 3))) ; this quiets things down (make-instance 'some-class)) #| In: DEFMETHOD FOOEY (T) (DEFMETHOD FOOEY (X) (MAKE-INSTANCE 'SOME-CLASS :SLOT X)) --> BLOCK MACROLET PCL::FAST-LEXICAL-METHOD-FUNCTIONS --> PCL::BIND-FAST-LEXICAL-METHOD-MACROS MACROLET --> PCL::BIND-LEXICAL-METHOD-FUNCTIONS LET PCL::BIND-ARGS LET* BLOCK ==> (PCL::|MAKE-INSTANCE COMMON-LISP-USER::SOME-CLASS (:SLOT) NIL| 'SOME-CLASS (LIST :SLOT X)) Warning: Undefined function: PCL::|MAKE-INSTANCE COMMON-LISP-USER::SOME-CLASS (:SLOT) NIL| Warning: This function is undefined: PCL::|MAKE-INSTANCE COMMON-LISP-USER::SOME-CLASS (:SLOT) NIL| |# --- pcl/fast-init.lisp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pcl/fast-init.lisp b/pcl/fast-init.lisp index a8084dc6e..b58f28a7f 100644 --- a/pcl/fast-init.lisp +++ b/pcl/fast-init.lisp @@ -1,4 +1,4 @@ -;;;-*-Mode:LISP; Package:(PCL LISP 1000); Base:10; Syntax:Common-lisp -*- +;;; -*- Mode: LISP; Package: PCL -*- ;;; ;;; ************************************************************************* ;;; Copyright (c) 1985, 1986, 1987, 1988, 1989, 1990 Xerox Corporation. @@ -26,7 +26,7 @@ ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/Attic/fast-init.lisp,v 1.5 1999/05/30 23:13:59 pw Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/Attic/fast-init.lisp,v 1.6 2001/01/27 15:07:45 pw Exp $") ;;; ;;; This file defines the optimized make-instance functions. ;;; @@ -68,8 +68,16 @@ (sym (make-instance-function-symbol key))) (push key *make-instance-function-keys*) (when sym + (progn ;; Lifted from c::%%defun. + (c::define-function-name sym) + (when (eq (ext:info function where-from sym) :assumed) + (setf (ext:info function where-from sym) :defined) + (when (ext:info function assumed-type sym) + (setf (ext:info function assumed-type sym) nil)))) `(,sym ',class (list ,@initargs))))))) + + (defmacro expanding-make-instance-top-level (&rest forms &environment env) (let* ((*make-instance-function-keys* nil) (form (macroexpand `(expanding-make-instance ,@forms) env))) -- GitLab