comparison lispref/compile.texi @ 52139:6a00e88ede75

(Compiler Errors): Explain with-no-warnings and other ways to suppress warnings.
author Richard M. Stallman <rms@gnu.org>
date Wed, 06 Aug 2003 01:17:13 +0000
parents d51ac8d52e63
children 9a786e2a1944
comparison
equal deleted inserted replaced
52138:b740243a935b 52139:6a00e88ede75
419 However, the warnings about functions that were used but not 419 However, the warnings about functions that were used but not
420 defined are always ``located'' at the end of the file, so these 420 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
427 @cindex byte-code function 463 @cindex byte-code function
428 464