Skip to content
Snippets Groups Projects
Commit 0eaf3074 authored by ram's avatar ram
Browse files

Bind compiler-warning-handler around compiler-warning calls in PRINT-SUMMARY so

that source context will be printed for undefined warnings.
parent 9624bd9f
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/main.lisp,v 1.89 1993/07/22 11:17:54 wlott Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/main.lisp,v 1.90 1993/07/25 21:25:43 ram Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -505,36 +505,37 @@ ...@@ -505,36 +505,37 @@
;;; ;;;
(defun print-summary (abort-p abort-count) (defun print-summary (abort-p abort-count)
(unless abort-p (unless abort-p
(let ((undefs (sort *undefined-warnings* #'string< (handler-bind ((warning #'compiler-warning-handler))
:key #'(lambda (x) (let ((undefs (sort *undefined-warnings* #'string<
(let ((x (undefined-warning-name x))) :key #'(lambda (x)
(if (symbolp x) (let ((x (undefined-warning-name x)))
(symbol-name x) (if (symbolp x)
(prin1-to-string x))))))) (symbol-name x)
(unless *converting-for-interpreter* (prin1-to-string x)))))))
(dolist (undef undefs) (unless *converting-for-interpreter*
(let ((name (undefined-warning-name undef)) (dolist (undef undefs)
(kind (undefined-warning-kind undef)) (let ((name (undefined-warning-name undef))
(warnings (undefined-warning-warnings undef)) (kind (undefined-warning-kind undef))
(count (undefined-warning-count undef))) (warnings (undefined-warning-warnings undef))
(dolist (*compiler-error-context* warnings) (count (undefined-warning-count undef)))
(compiler-warning "Undefined ~(~A~): ~S" kind name)) (dolist (*compiler-error-context* warnings)
(compiler-warning "Undefined ~(~A~): ~S" kind name))
(let ((warn-count (length warnings)))
(when (and warnings (> count warn-count)) (let ((warn-count (length warnings)))
(let ((more (- count warn-count))) (when (and warnings (> count warn-count))
(compiler-warning "~D more use~:P of undefined ~(~A~) ~S." (let ((more (- count warn-count)))
more kind name))))))) (compiler-warning "~D more use~:P of undefined ~(~A~) ~S."
more kind name)))))))
(dolist (kind '(:variable :function :type))
(let ((summary (mapcar #'undefined-warning-name (dolist (kind '(:variable :function :type))
(remove kind undefs :test-not #'eq (let ((summary (mapcar #'undefined-warning-name
:key #'undefined-warning-kind)))) (remove kind undefs :test-not #'eq
(when summary :key #'undefined-warning-kind))))
(compiler-warning (when summary
"~:[This ~(~A~) is~;These ~(~A~)s are~] undefined:~ (compiler-warning
~% ~{~<~% ~1:;~S~>~^ ~}" "~:[This ~(~A~) is~;These ~(~A~)s are~] undefined:~
(cdr summary) kind summary)))))) ~% ~{~<~% ~1:;~S~>~^ ~}"
(cdr summary) kind summary)))))))
(unless (or *converting-for-interpreter* (unless (or *converting-for-interpreter*
(and (not abort-p) (zerop abort-count) (and (not abort-p) (zerop abort-count)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment