From 4d31006db24db375cdb83a5726d66c524b36689c Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Thu, 2 Sep 2010 08:14:31 +0000 Subject: [PATCH] 1.0.42.24: print symbols with fully qualified names in critical places Patch by Attila Lendvai, lp#622789. Less room for package confusion this way. --- NEWS | 3 +++ src/code/class.lisp | 3 ++- src/code/condition.lisp | 8 +++++--- src/code/defmacro.lisp | 3 ++- src/code/defstruct.lisp | 3 ++- src/compiler/early-c.lisp | 3 ++- src/pcl/cpl.lisp | 9 ++++++--- src/pcl/macros.lisp | 3 ++- src/pcl/std-class.lisp | 2 +- version.lisp-expr | 2 +- 10 files changed, 26 insertions(+), 13 deletions(-) diff --git a/NEWS b/NEWS index 0758334..c802acd 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,9 @@ changes relative to sbcl-1.0.42 &co. * enhancement: ASDF has been updated to version 2.004. (lp#605260, thanks to Faré Rideau) + * enhancement: symbols are printed using fully qualified names in several + error and warning messages which are often associated with package + conflicts or mixups (lp#622789, thanks to Attila Lendvai) * bug fix: SB-BSD-SOCKETS:SOCKET-CONNECT was not thread safe. (lp#505497, thanks to Andrew Golding) * bug fix: DOTIMES accepted literal non-integer reals. (lp#619393, thanks to diff --git a/src/code/class.lisp b/src/code/class.lisp index 4e2d8fc..0db908d 100644 --- a/src/code/class.lisp +++ b/src/code/class.lisp @@ -767,7 +767,8 @@ (:primitive (error "Cannot redefine standard type ~S." name)) (:defined - (warn "Redefining DEFTYPE type to be a class: ~S" name) + (warn "redefining DEFTYPE type to be a class: ~ + ~/sb-impl::print-symbol-with-prefix/" name) (setf (info :type :expander name) nil (info :type :lambda-list name) nil (info :type :source-location name) nil))) diff --git a/src/code/condition.lisp b/src/code/condition.lisp index 1ba4f0b..dbd3bfc 100644 --- a/src/code/condition.lisp +++ b/src/code/condition.lisp @@ -680,7 +680,7 @@ (:report (lambda (condition stream) (format stream - "The function ~S is undefined." + "The function ~/sb-impl::print-symbol-with-prefix/ is undefined." (cell-error-name condition))))) (define-condition special-form-function (undefined-function) () @@ -1353,14 +1353,16 @@ handled by any other handler, it will be muffled.") (new-location :initarg :new-location :reader redefinition-with-defun-new-location)) (:report (lambda (warning stream) - (format stream "redefining ~S in DEFUN" + (format stream "redefining ~/sb-impl::print-symbol-with-prefix/ ~ + in DEFUN" (function-redefinition-warning-name warning))))) (define-condition redefinition-with-defgeneric (function-redefinition-warning) ((new-location :initarg :new-location :reader redefinition-with-defgeneric-new-location)) (:report (lambda (warning stream) - (format stream "redefining ~S in DEFGENERIC" + (format stream "redefining ~/sb-impl::print-symbol-with-prefix/ ~ + in DEFGENERIC" (function-redefinition-warning-name warning))))) (define-condition redefinition-with-defmethod (redefinition-warning) diff --git a/src/code/defmacro.lisp b/src/code/defmacro.lisp index 39ec97c..c43a723 100644 --- a/src/code/defmacro.lisp +++ b/src/code/defmacro.lisp @@ -89,7 +89,8 @@ ;; being incompatibly redefined. Doing this right ;; will involve finding the old macro lambda-list ;; and comparing it with the new one. - (style-warn "redefining ~S in DEFMACRO" name)) + (style-warn "redefining ~/sb-impl::print-symbol-with-prefix/ ~ + in DEFMACRO" name)) (setf (sb!xc:macro-function name) definition) ,(when set-p `(setf (%fun-doc definition) doc diff --git a/src/code/defstruct.lisp b/src/code/defstruct.lisp index 76f3c83..3d3e32c 100644 --- a/src/code/defstruct.lisp +++ b/src/code/defstruct.lisp @@ -732,7 +732,8 @@ ;;x#-sb-xc-host ;;x(when (and (fboundp accessor-name) ;;x (not (accessor-inherited-data accessor-name defstruct))) - ;;x (style-warn "redefining ~S in DEFSTRUCT" accessor-name))) + ;;x (style-warn "redefining ~/sb-impl::print-symbol-with-prefix/ ~ + ;; in DEFSTRUCT" accessor-name))) ;; which was done until sbcl-0.8.11.18 or so, is wrong: it causes ;; a warning at MACROEXPAND time, when instead the warning should ;; occur not just because the code was constructed, but because it diff --git a/src/compiler/early-c.lisp b/src/compiler/early-c.lisp index 21f89b5..bb883b4 100644 --- a/src/compiler/early-c.lisp +++ b/src/compiler/early-c.lisp @@ -186,7 +186,8 @@ the stack without triggering overflow protection.") ;; FIXME: should be COMPILER-STYLE-WARNING? (style-warn 'sb!kernel:asterisks-around-lexical-variable-name :format-control - "using the lexical binding of the symbol ~S, not the~@ + "using the lexical binding of the symbol ~ + ~/sb-impl::print-symbol-with-prefix/, not the~@ dynamic binding" :format-arguments (list symbol))) (values)) diff --git a/src/pcl/cpl.lisp b/src/pcl/cpl.lisp index e1ac1aa..7bae6a2 100644 --- a/src/pcl/cpl.lisp +++ b/src/pcl/cpl.lisp @@ -200,14 +200,16 @@ (defun cpl-error (class format-string &rest format-args) (error "While computing the class precedence list of the class ~A.~%~A" (if (class-name class) - (format nil "named ~S" (class-name class)) + (format nil "named ~/sb-impl::print-symbol-with-prefix/" + (class-name class)) class) (apply #'format nil format-string format-args))) (defun cpl-forward-referenced-class-error (class forward-class) (flet ((class-or-name (class) (if (class-name class) - (format nil "named ~S" (class-name class)) + (format nil "named ~/sb-impl::print-symbol-with-prefix/" + (class-name class)) class))) (if (eq class forward-class) (cpl-error class @@ -256,7 +258,8 @@ (flet ((class-or-name (cpd) (let ((class (cpd-class cpd))) (if (class-name class) - (format nil "named ~S" (class-name class)) + (format nil "named ~/sb-impl::print-symbol-with-prefix/" + (class-name class)) class)))) (mapcar (lambda (reason) diff --git a/src/pcl/macros.lisp b/src/pcl/macros.lisp index 996e05f..80dab6b 100644 --- a/src/pcl/macros.lisp +++ b/src/pcl/macros.lisp @@ -96,7 +96,8 @@ (ensure-non-standard-class symbol classoid)))))) (cond ((null errorp) nil) ((legal-class-name-p symbol) - (error "There is no class named ~S." symbol)) + (error "There is no class named ~ + ~/sb-impl::print-symbol-with-prefix/." symbol)) (t (error "~S is not a legal class name." symbol))))) diff --git a/src/pcl/std-class.lisp b/src/pcl/std-class.lisp index c7869ec..b1a60df 100644 --- a/src/pcl/std-class.lisp +++ b/src/pcl/std-class.lisp @@ -963,7 +963,7 @@ (style-warn "~@~@:>" + for class ~S:~4I~@:_~<~@{~/sb-impl::print-symbol-with-prefix/~^~:@_~}~:>~@:>" class dupes))) (let* ((slot (car slots)) (oslots (remove (slot-definition-name slot) (cdr slots) diff --git a/version.lisp-expr b/version.lisp-expr index f609b1b..eda5465 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.42.23" +"1.0.42.24" -- 1.7.10.4