diff options
| author | Richard M. Stallman | 2003-08-06 01:17:13 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-08-06 01:17:13 +0000 |
| commit | fe45b975b94bccc550eafc37b160bdd8695e8d46 (patch) | |
| tree | 2d4726fccd8656859bbfbedb0b5d1898c9032202 | |
| parent | 8e5f951071ef79a55a58cf4a1247ec18798dc94c (diff) | |
| download | emacs-fe45b975b94bccc550eafc37b160bdd8695e8d46.tar.gz emacs-fe45b975b94bccc550eafc37b160bdd8695e8d46.zip | |
(Compiler Errors): Explain with-no-warnings
and other ways to suppress warnings.
| -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 | |||
| 421 | commands won't find the places they are really used. To do that, | 421 | commands won't find the places they are really used. To do that, |
| 422 | you must search for the function names. | 422 | you must search for the function names. |
| 423 | 423 | ||
| 424 | You can suppress the compiler warning for calling an undefined | ||
| 425 | function @var{func} by conditionalizing the function call on a | ||
| 426 | @code{fboundp} test, like this: | ||
| 427 | |||
| 428 | @example | ||
| 429 | (if (fboundp '@var{func}) ...(@var{func} ...)...) | ||
| 430 | @end example | ||
| 431 | |||
| 432 | @noindent | ||
| 433 | The call to @var{func} must be in the @var{then-form} of the @code{if}, | ||
| 434 | and @var{func} must appear quoted in the call to @code{fboundp}. | ||
| 435 | Likewise, you can suppress a compiler warning for an unbound variable | ||
| 436 | @var{variable} by conditionalizing its use on a @code{boundp} test, | ||
| 437 | like this: | ||
| 438 | |||
| 439 | @example | ||
| 440 | (if (boundp '@var{variable}) ...@var{variable}...) | ||
| 441 | @end example | ||
| 442 | |||
| 443 | @noindent | ||
| 444 | The reference to @var{variable} must be in the @var{then-form} of the | ||
| 445 | @code{if}, and @var{variable} must appear quoted in the call to | ||
| 446 | @code{boundp}. | ||
| 447 | |||
| 448 | You can suppress any compiler warnings using the construct | ||
| 449 | @code{with-no-warnings}: | ||
| 450 | |||
| 451 | @defmac with-no-warnings body... | ||
| 452 | In execution, this is equivalent to @code{(progn @var{body}...)}, | ||
| 453 | but the compiler does not issue warnings for anything that occurs | ||
| 454 | inside @var{body}. | ||
| 455 | |||
| 456 | We recommend that you use this construct around the smallest | ||
| 457 | possible piece of code. | ||
| 458 | @end defun | ||
| 459 | |||
| 424 | @node Byte-Code Objects | 460 | @node Byte-Code Objects |
| 425 | @section Byte-Code Function Objects | 461 | @section Byte-Code Function Objects |
| 426 | @cindex compiled function | 462 | @cindex compiled function |