On Tue, Aug 28, 2007 at 03:22:33PM +0100, Simon Peyton-Jones wrote:
> Norman's suggestion for warnings when building GHC.
I was actually thinking about warnings the other day. The problem is
that to keep code warning free you really need -Werror, or people won't
notice and fix them, but that's a pain while developing (e.g. you
comment out a chunk of code temporarily and suddenly you have a load of
unused variable warnings, so you have to keep disabling -Werror when
developing). But now we have the validate script, we can make that set
-Werror and it won't get in the way while developing.
> 1. Switch warnings off by default in build.mk.sample. Reason: too many are
> generated.
>
> 2. Whenever a developer does non-trivial work on a module, ask them to
> a) add {-# OPTIONS_GHC -Wall #-} to the top
> b) modify the code (including stuff predating theirs) to eliminate
> warnings
So far I've just been making each separate unit warning-free when I was
doing some work on it, e.g. utils/ghc-pkg/Makefile now sets -Wall. For
the libraries this is becoming easier to do at one sitting as base gets
split up.
Perhaps compiler/ is too large and warningful for this to be feasible,
though.
> With a bit of luck, we'd get more and more modules with useful
> warnings; and all warnings would be relevant.
Sounsd good to me!
> Concerning 2(a) just which warnings do we want on? Norman's suggestion is:
> all except name-shadowing. (ML heritage; but also useful in stateful monadic
> code.)
I'd go for plain old -Wall, personally.
How much is this style of name shadowing used in GHC? Do people think it
is desirable?
Thanks
Ian
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc