[GHC] #9854: Literal overflow check is too aggressive

GHC ghc-devs at haskell.org
Tue Aug 21 10:36:54 UTC 2018


#9854: Literal overflow check is too aggressive
-------------------------------------+-------------------------------------
        Reporter:  tibbe             |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.8.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  warning at compile-time            |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by nh2):

 * cc: nh2 (added)


Comment:

 I think we should always warn on literal integer overflow, and disabled
 only by explicit programmer annotation, not matter if it's common practice
 or not.

 Hex or not, you may just have misremembered what the range of your value
 is.

 Rust is also pushing people away from such common practice overflows into
 the, in my opinion very positive, direction of always warning on possible
 programmer errors and demanding explicit annotations.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9854#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list