diff options
author | Richard M. Stallman <rms@gnu.org> | 2003-08-06 01:17:13 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2003-08-06 01:17:13 +0000 |
commit | fe45b975b94bccc550eafc37b160bdd8695e8d46 (patch) | |
tree | 2d4726fccd8656859bbfbedb0b5d1898c9032202 /lispref/compile.texi | |
parent | 8e5f951071ef79a55a58cf4a1247ec18798dc94c (diff) | |
download | emacs-fe45b975b94bccc550eafc37b160bdd8695e8d46.tar.gz |
(Compiler Errors): Explain with-no-warnings
and other ways to suppress warnings.
Diffstat (limited to 'lispref/compile.texi')
-rw-r--r-- | lispref/compile.texi | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lispref/compile.texi b/lispref/compile.texi index 583454efe73..5ce8c45ee9e 100644 --- a/lispref/compile.texi +++ b/lispref/compile.texi @@ -421,6 +421,42 @@ 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 @var{func} by conditionalizing the function call on a +@code{fboundp} test, like this: + +@example +(if (fboundp '@var{func}) ...(@var{func} ...)...) +@end example + +@noindent +The call to @var{func} must be in the @var{then-form} of the @code{if}, +and @var{func} must appear quoted in the call to @code{fboundp}. +Likewise, you can suppress a compiler warning for an unbound variable +@var{variable} by conditionalizing its use on a @code{boundp} test, +like this: + +@example +(if (boundp '@var{variable}) ...@var{variable}...) +@end example + +@noindent +The reference to @var{variable} must be in the @var{then-form} of the +@code{if}, and @var{variable} must appear quoted in the call to +@code{boundp}. + + You can suppress any compiler warnings using the construct +@code{with-no-warnings}: + +@defmac with-no-warnings body... +In execution, this is equivalent to @code{(progn @var{body}...)}, +but the compiler does not issue warnings for anything that occurs +inside @var{body}. + +We recommend that you use this construct around the smallest +possible piece of code. +@end defun + @node Byte-Code Objects @section Byte-Code Function Objects @cindex compiled function |