X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fcompiler-error.lisp;h=0c5e75148672a7a2181a5e02ba31c4b182856a67;hb=98a76d4426660876dec6649b1e228d2e5b47f579;hp=ac85e40a0bbf34d7ea93477f3e4568377448b27e;hpb=1bfc464c657a8f4ad24ef612f76a38d8f6f1bbad;p=sbcl.git diff --git a/src/compiler/compiler-error.lisp b/src/compiler/compiler-error.lisp index ac85e40..0c5e751 100644 --- a/src/compiler/compiler-error.lisp +++ b/src/compiler/compiler-error.lisp @@ -25,9 +25,14 @@ (defvar *compiler-error-bailout* (lambda () (error "COMPILER-ERROR with no bailout"))) -;;; We have a separate COMPILER-ERROR condition to allow us to -;;; distinguish internal compiler errors from user errors. -;;; Non-compiler errors put us in the debugger. +;;; an application programmer's error caught by the compiler +;;; +;;; We want a separate condition for application programmer errors so +;;; that we can distinguish them from system programming errors (bugs +;;; in SBCL itself). Application programmer errors should be caught +;;; and turned into diagnostic output and a FAILURE-P return value +;;; from COMPILE or COMPILE-FILE. Bugs in SBCL itself throw us into +;;; the debugger. (define-condition compiler-error (simple-error) ()) ;;; Signal the appropriate condition. COMPILER-ERROR calls the bailout @@ -47,13 +52,11 @@ :format-control format-string :format-arguments format-args) (funcall *compiler-error-bailout*) - ;; FIXME: It might be nice to define a BUG or OOPS function for "shouldn't - ;; happen" cases like this. - (error "internal error, control returned from *COMPILER-ERROR-BAILOUT*")) -(defun compiler-warning (format-string &rest format-args) + (bug "Control returned from *COMPILER-ERROR-BAILOUT*.")) +(defun compiler-warn (format-string &rest format-args) (apply #'warn format-string format-args) (values)) -(defun compiler-style-warning (format-string &rest format-args) +(defun compiler-style-warn (format-string &rest format-args) (apply #'style-warn format-string format-args) (values))