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 = f t x
          t = 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
| 
| If I complile the code:
| 
| > module Wall () where
| > f x = f x
| 
| 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:
| 
| > module Wall () where
| > g x = h x
| > h x = g x
| 
| does not yield warnings for unused definitions...
| 
| Is there a reason for this (i.e., is the common behavior in other
| compilers)?
| 
|  - Hal
| 
| --
| Hal Daume III
| 
|  "Computer science is no more about computers    | [EMAIL PROTECTED]
|   than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume
| 
| _______________________________________________
| Glasgow-haskell-users mailing list
| [EMAIL PROTECTED]
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to