[GHC] #7895: Warning for literal overflow

#7895: Warning for literal overflow -----------------------------+---------------------------------------------- Reporter: acube | Owner: Type: feature request | Status: new Priority: normal | Component: Compiler Version: 7.6.3 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Other | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Using ghc 7.6.3, the following compiles without warnings on -Wall: {{{ import Data.Word test :: Word8 test = 300 main = print test }}} I expected this to issue a warning like: "Warning: literal overflow on line 4". I know GCC for example does this and it would be nice if GHC did this too. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7895 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7895: Warning for literal overflow -----------------------------+---------------------------------------------- Reporter: acube | Owner: Type: feature request | Status: new Priority: normal | Component: Compiler Version: 7.6.3 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Other | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by carter): I'm not sure theres a good way to do this... GHC currently lacks any model or "theory of integers", so can't reason about over/underflows presently, let alone issue a warning on them. This is related to the "better numerics" tickets listed here http://hackage.haskell.org/trac/ghc/wiki/Status/SLPJ-Tickets -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7895#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC