[GHC] #12849: hsc2hs trouble with floating-point constants in cross-compilation mode

GHC ghc-devs at haskell.org
Thu Nov 17 21:10:13 UTC 2016


#12849: hsc2hs trouble with floating-point constants in cross-compilation mode
-------------------------------------+-------------------------------------
        Reporter:  rwbarton          |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  hsc2hs            |              Version:  7.8.4
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 A separate issue about hsc2hs and floating-point types: the argument to
 `#const` gets cast to `long` in direct mode. The hsc2hs manual alludes to
 this, but does not state it explicitly. So for example, `#const (-1.9)`
 produces the output `-1`. We should state this explicitly in the manual,
 and also insert a cast to `long` in the cross-compilation code path to
 ensure that it matches the direct code path output.

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


More information about the ghc-tickets mailing list