-Wall with recursive functions

Simon Peyton-Jones simonpj@microsoft.com
Tue, 5 Nov 2002 09:52:50 -0000


This is a long-standing bug which is rather tiresome to fix in general.


What I've done is to commit a fix that finds the unused bindings you
give, but does not find transitive ones.  For example
	Module Foo() where
	  f x =3D f t x
	  t =3D 3

Here f is used, and therefore so is t.  The quick fix will find the
first but not the second.  Ah well, it's an improvement

Simon

| -----Original Message-----
| From: Hal Daume III [mailto:hdaume@ISI.EDU]
| Sent: 04 November 2002 18:02
| To: GHC Users Mailing List
| Subject: -Wall with recursive functions
|=20
| If I complile the code:
|=20
| > module Wall () where
| > f x =3D f x
|=20
| With -Wall, I do *not* get a "defined by not used" warning on f, which
I
| think I should.  The same thing happens for mutually-recursive
functions:
|=20
| > module Wall () where
| > g x =3D h x
| > h x =3D g x
|=20
| does not yield warnings for unused definitions...
|=20
| Is there a reason for this (i.e., is the common behavior in other
| compilers)?
|=20
|  - Hal
|=20
| --
| Hal Daume III
|=20
|  "Computer science is no more about computers    | hdaume@isi.edu
|   than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume
|=20
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users@haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users