Subject: Re: Telling compiler to shutup about warnings?

From: haible (Bruno Haible)
Date: Thu, 13 Apr 95 22:36:21 +0200

Raymond Toy <[email-masked]> asks:

> I'm compiling a function
> which has some unused variables in it, and I don't want the warnings to
> be displayed.

There are two commonly used strategies to overcome this problem:

- Evaluate the variables at least once, like this:
  (LAMBDA (ARG1 ARG2 &REST ARGS) ARG1 ARG2 ARGS (PROGN ,@function-body))
  Every compiler will eliminate the evaluations of the variables at these
  positions. Stepping through this kind of code will become annoying,
  however.

- Some compilers have appropriate declarations. You can thus write
  (LAMBDA (ARG1 ARG2 &REST ARGS)
    #+CLISP (DECLARE (SYSTEM::IGNORABLE ARG1 ARG2 ARGS))
    ,@function-body
  )

In CLISP, unused variable warnings are also suppressed for GENSYM generated
variables. (This is a hack predating the IGNORABLE declaration.)

> How can I tell the compiler to be quiet?

Bind *COMPILE-WARNINGS* to NIL, or give COMPILE-FILE the arguments
:WARNINGS NIL.

                    Bruno Haible
                    [email-masked]

!! To unsubscribe from the clisp-list mailing list, send mail to     !!
!!           [email-masked]              !!
!! including the two words "unsubscribe clisp-list" as message body. !!

---

From: Raymond Toy <[email-masked]>
Date: Thu, 13 Apr 1995 16:42:47 -0400

>>>>> "Bruno" == Bruno Haible <[email-masked]> writes:

    Bruno> There are two commonly used strategies to overcome this
    Bruno> problem:

The first strategy works just fine.  It's the obvious solution, but
not obvious enough to me!

Thanks,

Ray