#1292: -fwarn-monomorphism-restriction should be -Wmonomorphism-restriction
-------------------------+--------------------------------------------------
    Reporter:  guest     |        Owner:         
        Type:  bug       |       Status:  closed 
    Priority:  normal    |    Milestone:         
   Component:  Compiler  |      Version:  6.7    
    Severity:  normal    |   Resolution:  invalid
    Keywords:            |   Difficulty:  Unknown
          Os:  Unknown   |     Testcase:         
Architecture:  Unknown   |  
-------------------------+--------------------------------------------------
Comment (by igloo):

 (Can you please not close bugs without comment or anonymously? Thanks)

 On the name of the flag, `-fwarn` rather than `-W` seems to be the naming
 convention.

 However, on having the warning on by default:

 We've seen a number of failures in the HEAD+extralibs build because of
 this warning,
 e.g. a warning about `index` in the below snippet from regex-compat:
 {{{
 else let index = (read (head bgroups)) - 1
      in
      if index == -1
         then match
         else groups !! index
 }}}
 Here, and I imagine everywhere (non-contrived) that compilation succeeds,
 monomorphism is exactly what we want. As I believe it is a good policy to
 keep code `-Wall` clean, I personally would not like this warning to be
 enabled even by `-Wall`. Debatably it would be good style to add a type
 signature for `index`, though.

 The warning may be useful for people investigating removing or replacing
 the MR, but they can enable it themselves.

 It may also be useful to show any such warnings when compilation fails,
 but that feels like a bit of a hack and may result in a flood of unrelated
 warnings when a single error occurs.

 I've turned the warning off for now, so at least it won't break the
 nightly builds.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1292>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to