emacs-devel
[Top][All Lists]
Advanced

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

Re: cc-vars.el


From: Miles Bader
Subject: Re: cc-vars.el
Date: 19 Nov 2002 10:40:42 +0900

Martin Stjernholm <address@hidden> writes:
> Dave Love <address@hidden> wrote:
> > A change for that I once suggested greatly reduced the noise and I
> > don't think it's a big issue to re-write a few things to forms such a
> > compiler check would be documented to recognize.
>
> Don't you rather mean code like this?
> 
>     (if (fboundp 'fred)
>         (fred ...))
> 
> It'd be cool if the compiler did enough flow analysis to cope with
> that, but it might be hard to get it to work well, and if it doesn't
> work well then I'd prefer to have the possibility to control the
> warnings explicitly with some pragma-like system.

The emacs compiler isn't particularly clever, but it could match certain
specified forms like the above without much trouble.  Such forms would
be explicitly defined to have this effect, and it would be up to
programmers to use the correct form (since the only effect of not doing
it right is a warning, it's not a big problem to be so picky).

E.g. when it sees (if (fboundp 'SYMBOL) ACTION ...), it could push
SYMBOL on a list of functions not to warn about, while it was compiling
ACTION.  [other forms that macroexpand into `if' without modifying the
condition would work too]

_That_ sort of change is pretty easy, and has the advantage of working
even with old compilers that don't special case it (they'll just emit a
warning like before, but the generated code will be the same).

[Think of it as a pragma expressed in code...]

-Miles
-- 
Yo mama's so fat when she gets on an elevator it HAS to go down.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]