[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] scrutiny
From: |
Peter Bex |
Subject: |
Re: [Chicken-users] scrutiny |
Date: |
Fri, 29 May 2009 20:35:07 +0200 |
User-agent: |
Mutt/1.4.2.3i |
On Fri, May 29, 2009 at 04:18:55PM +0200, felix winkelmann wrote:
> Hello!
>
> I have merged the recent work on the "scrutiny" branch into trunk (r14828).
> "Scrutiny" is a lightweight local conservative (read: simple) flow analysis
> pass over the internal representation of the code and performs a check on
> argument-count/-types and results of calls to core library procedures.
> Additionally, the number of result values is checked in various places.
This is really great!
> It is likely that the type-database still contains some bugs, so if you
> try it out and get strange warnings, please mail them to me.
The one thing that I keep getting when I compile
is warnings that procedures return a different number of arguments in
branches like this:
(if (number? foo)
(values foo (add1 foo))
(error "foo is not a number"))
I think procedures like ERROR, RAISE etc that can invoke different
continuations should probably be treated specially.
Also, it gives errors for each branch of a COND:
(cond ((number? foo) (values foo (add1 foo)))
((string? foo) (values foo (string-append foo " etc")))
(else (error "blah")))
This is a bit annoying in 9p for example, where there's a procedure
with 7 cases and one error in the ELSE branch, it gives 7 warnings :)
> Usage is simple: just pass "-scrutinize" (or "-S" in csc).
Why is it not enabled by default? It only issues warnings, so even if
it's wrong, it'll still compile the code properly...
Cheers,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth
pgphoubievnet.pgp
Description: PGP signature