Next: Diagnostic Severity, Up: Diagnostic Messages

#### 4.1.1 Controlling Verbosity

The compiler can be quite verbose in its diagnostic reporting, rather more then some users would prefer – the amount of noise emitted can be controlled, however.

To control emission of compiler diagnostics (of any severity other than `error`: see Diagnostic Severity) use the `sb-ext:muffle-conditions` and `sb-ext:unmuffle-conditions` declarations, specifying the type of condition that is to be muffled (the muffling is done using an associated `muffle-warning` restart).

Global control:

         ;;; Muffle compiler-notes globally
         (declaim (sb-ext:muffle-conditions sb-ext:compiler-note))

Local control:

         ;;; Muffle compiler-notes based on lexical scope
         (defun foo (x)
           (declare (optimize speed) (fixnum x)
                    (sb-ext:muffle-conditions sb-ext:compiler-note))
           (values (* x 5) ; no compiler note from this
             (locally
               (declare (sb-ext:unmuffle-conditions sb-ext:compiler-note))
               ;; this one gives a compiler note
               (* x -5))))

— Declaration: sb-ext:muffle-conditions

> Syntax: type*

> Muffles the diagnostic messages that would be caused by compile-time signals of given types.

— Declaration: sb-ext:unmuffle-conditions

> Syntax: type*

> Cancels the effect of a previous `sb-ext:muffle-condition` declaration.

Various details of how the compiler messages are printed can be controlled via the alist `sb-ext:*compiler-print-variable-alist*`.

— Variable: sb-ext:*compiler-print-variable-alist*

> an association list describing new bindings for special variables to be used by the compiler for error-reporting, etc. Eg.

>                ((*PRINT-LENGTH* . 10) (*PRINT-LEVEL* . 6) (*PRINT-PRETTY* . NIL))

> The variables in the `car` positions are bound to the values in the `cdr` during the execution of some debug commands. When evaluating arbitrary expressions in the debugger, the normal values of the printer control variables are in effect.

> Initially empty, `*compiler-print-variable-alist*` is Typically used to specify bindings for printer control variables.

For information about muffling warnings signaled outside of the compiler, see Customization Hooks for Users.