[GHC] #13620: hsc2hs parses incorrectly '#ifdef' under '#{enum' in '--cross-compile' mode

GHC ghc-devs at haskell.org
Wed Apr 26 21:23:49 UTC 2017


#13620: hsc2hs parses incorrectly '#ifdef' under '#{enum' in '--cross-compile' mode
-------------------------------------+-------------------------------------
           Reporter:  slyfox         |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  hsc2hs         |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 The code is simplified version of something from Win32 package
 (https://github.com/haskell/win32/blob/master/System/Win32/SimpleMAPI.hsc#L56):

 {{{#!hs
 #{enum Int ,
  , a       = sizeof(int)
 #if 0
  , b       = sizeof(char)
 #endif
  }
 }}}

 {{{
 $ hsc2hs b.hsc -o b.hs-native
 $ hsc2hs b.hsc -o b.hs-cross --cross-compile
 b.hsc:1  sizeof(int)
 #if 0
   is not an integer
 }}}

 I'm not sure if it's a valid .hsc but having at least the same (valid or
 invalid) result in both modes would be nice.

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


More information about the ghc-tickets mailing list