6.1 About the Compiler

6.1.3 Compiler messages and warnings

The Compiler provides messages and warnings that give information about the progress of a compilation. These messages and warnings can be suppressed.

The Compiler provides the following types of messages and warnings:

These messages provide information about the compilation; they include the message"Compiling function...", which identifies the function that is being compiled.

Compiler messages are suppressed by default. You can turn them on by calling the functioncompile,compile-file, orcompiler-options with the keyword argument:messages specified ast.

These messages provide information about the compilation of files; they include the messages"Reading source file..." and"Writing binary file...", which identify the file that is being compiled.

Compiler file messages are displayed by default. You can suppress them by calling the functioncompile,compile-file, orcompiler-options with the keyword argument:file-messages specified asnil.

These messages tell you whether you are using the production mode or the development mode of the Compiler. Optimization mode messages are displayed by default. You can suppress them by calling the functioncompile,compile-file, orcompiler-options with the keyword argument:optimize-message specified asnil. If:optimize-message is specified as:terse, the Compiler displays terse mode messages.

These messages provide warnings about certain situations, such as when an undefined function is called or when a variable is referenced out of scope. For example, if you compile a function that contains a free reference to a variable that has not been declaredspecial, the Compiler issues a warning similar to the following:

> (defun bad-function (x)
    (+ x y))
BAD-FUNCTION

> (compile 'bad-function) ;;; Warning: Free variable Y assumed to be special BAD-FUNCTION

Unless instructed otherwise, the Compiler prints a warning for every call in the source code to a function that is not defined in the current image or in the file being compiled. You can suppress or defer undefined function warnings in various ways:

(compiler-options :undef-warnings nil)
(declare (ftype (function (t) t) my-function))
(with-deferred-warnings (compile-file "my-file")
                        (compile-file "my-other-file"))

Chapter 3, "Optimizing Lisp Programs" in The Advanced User's Guide describesftype declarations and the macrowith-deferred-warnings.


The User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker