Next: Byte-Code Objects, Previous: Eval During Compile, Up: Byte Compilation
Byte compilation outputs all errors and warnings into the buffer `*Compile-Log*'. The messages include file names and line numbers that identify the location of the problem. The usual Emacs commands for operating on compiler diagnostics work properly on these messages.
However, the warnings about functions that were used but not defined are always “located” at the end of the file, so these commands won't find the places they are really used. To do that, you must search for the function names.
You can suppress the compiler warning for calling an undefined
function func by conditionalizing the function call on an
fboundp test, like this:
(if (fboundp 'func) ...(func ...)...)
The call to func must be in the then-form of the
if, and func must appear quoted in the call to
fboundp. (This feature operates for cond as well.)
Likewise, you can suppress a compiler warning for an unbound variable
variable by conditionalizing its use on a boundp test,
like this:
(if (boundp 'variable) ...variable...)
The reference to variable must be in the then-form of the
if, and variable must appear quoted in the call to
boundp.
You can suppress any compiler warnings using the construct
with-no-warnings:
In execution, this is equivalent to
(prognbody...), but the compiler does not issue warnings for anything that occurs inside body.We recommend that you use this construct around the smallest possible piece of code.