[GHC] #7983: Bug in hsc2hs --cross-safe

GHC ghc-devs at haskell.org
Thu Nov 17 20:24:26 UTC 2016


#7983: Bug in hsc2hs --cross-safe
-------------------------------------+-------------------------------------
        Reporter:  singpolyma        |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  hsc2hs            |              Version:  7.6.3
      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):

 There seem to be two issues here.

 1. The program is accepted by `hsc2hs --cross-safe` even though it's
 rejected by `hsc2hs --cross-compile`.

 2. The program is rejected by `hsc2hs --cross-compile` for reasons that
 seem to have to do with the use of doubles.

 The ticket seems to have been intended to be about 1, since it's titled
 "Bug in `hsc2hs --cross-safe`". In general this has nothing to do with the
 weirdness of point 2. For example, you could write something clearly non-
 constant like `(#const getpid())`. hsc2hs will accept this in direct mode,
 which is okay I think; but it certainly won't work in cross-compiling
 mode, so `hsc2hs --cross-safe` should reject it too.

 I think this should be easy to implement: just include the output of
 `CrossCodegen.outValidityCheck` in the direct code generation path as
 well, if `--cross-safe` is enabled.

 I will create a separate ticket for point 2.

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


More information about the ghc-tickets mailing list