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

Compiler Warnings, again

To:     Michael Pazzani    pazzani@pan.ics.uci.edu
cc:     info-mcl
From:   Steve Mitchell
Date:   03-15-92
Sub:    Compiler Warnings, again
>  I fully understand that compiler warnings serve a purpose and turning
>  them off is a bad idea.  But here's my problem.  I'm working with
>  a system that compiles into lisp. In particular, it converts horn clause
>  rules to lisp functions and then compiles those function (Thanks Norvig).
>  Unfortunately, things like singleton variables in a prolog clause
>  are converted into unused lexical variables.  So I changed the compiler
>  to use (declare (ignore-if-unused ...)) in each call.  Now, prolog
>  predicates that are not (yet) defined cause "Undefined functions" warnings.
You've acknowleged that turning off compiler warnings is a bad idea. As far
as I can see, the "Undefined functions" warnings are the only ones at issue
here so what you need is a counterpart to (declare (ignore-if-unused ...)):
     (declare (ftype (function (*) *) fn-name))
          and at top-level:
     (declaim (ftype (function (&rest t) t) fn-name))
     I'm not sure of the exact MCL 2.0b1 syntax.
>  I'm sure if I try hard enough, I can get around this, but I'd rather
>  not anticipate every possible warning and correct for it.  I really
>  want to turn off all warnings.  If I promise to use it only in
>  (without-compiler-warnings (compile (convert-to-lisp-function ....)))
>  can I get a hint on how to write without-compiler-warnings.
Perhaps someone could "compile" a list of all the possible warnings, and
the proper way to declare each one away for those cases where we're sure
we know what we're doing. without-compiler-warnings is trivial to write,
but requires an undocumented internal MCL feature. And we're agreed that
it's a bad idea to turn off all warnings.