[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to get rid of extra warnings ?



> The machine generated code has quite often variables that are never
> used. As a result I get several screenfulls of warnings:
> 
>   ; While compiling (:anonymous-lambda 246):
>   Warning: variable CO is never used
>   Warning: variable MA is never used
> 
> 
> Does anybody know how to get rid of these annoying messages ?

Yes.  If your code generator can easily determine which variables are
used and which aren't, you can add IGNORED declarations for the unused
variables.

	(let ((foo ...) (bar ...))
	  (declare (ignore bar))
	  ;; generated code that uses FOO, but not BAR
	  ...)

If this is somehow difficult, use the IGNORABLE declaration on all
potentially unused variables:

	(let ((foo ...) (bar ...))
	  (declare (ignorable foo bar))
	  ;; generated code that may or may not use FOO and BAR
	  ...)
-- 
Simon.