[Haskell-cafe] Best idiom for avoiding Defaulting warnings with ghc -Wall -Werror ??

Jaap Weel jaapweel at gmail.com
Mon Jun 25 13:47:20 EDT 2007


> I've been going over my code trying to get it all to compile with
> "ghc -Wall -Werror"

I recently ran across what may be a good reason not to use -Wall in
combination with -Werror (and similar combinations in other
compilers), at least not as the standard build switches for software
you intend to distribute. It causes bitrot, because -Wall will in the
future turn on warnings that don't even exist yet today, and -Werror
will turn those warnings into errors. The upshot is that you can write
code that entirely follows the standard that defines whatever language
you're using (e.g. Haskell 98), and still have it break in the future,
even if future compilers adhere to the standard. If you are serious
about writing portable and durable code, you may want to avoid this.

(I ran into this problem while trying to resurrect an excellent but
unmaintained compiler written in lots of OCaml and a little C. Both
ocaml and gcc have grown many new warnings in the last few years.)

--

  /jaap




More information about the Haskell-Cafe mailing list