
Hi there, From my experiences in programming it is usually a good thing when a compiler issues warnings because this shows me where in my code there might be future problems hidden. I found the following warnings especially important to be turned on: -fwarn-incomplete-patterns -fwarn-overlapping-patterns -fwarn-name-shadowing -fwarn-unused-matches -fwarn-unused-do-bind I see that I could turn on all warnings with -Wall but that is a bit too much. My question: what other options do people recommend to be turned on. -- Manfred

On Sunday 03 April 2011 17:24:52, Manfred Lotz wrote:
Hi there, From my experiences in programming it is usually a good thing when a compiler issues warnings because this shows me where in my code there might be future problems hidden.
I found the following warnings especially important to be turned on:
-fwarn-incomplete-patterns -fwarn-overlapping-patterns -fwarn-name-shadowing -fwarn-unused-matches
-fwarn-unused-do-bind
I find that one rather annoying most of the time. It's good if you write stuff like do foo mapM bar baz quux but it's just superfluous in situations like do foo printf format some vars bar baz which I have much more frequently (I don't remember ever having typo'ed mapM when I meant mapM_ or similar, doesn't mean it never happened, but it's rare - for me, at least)
I see that I could turn on all warnings with -Wall but that is a bit too much.
I tend to use -Wall -fwarn-tabs -fno-warn-unused-do-bind -fno-warn-type-defaults (unless I want to be warned on type-defaulting or unused do-binds, of course). Switch on everything and explicitly switch off what you consider okay in that module.
My question: what other options do people recommend to be turned on.
-fwarn-tabs -fwarn-missing-signatures -fwarn-orphans
participants (2)
-
Daniel Fischer
-
Manfred Lotz