#2250: unpackFamily on Windows 2008 fails match
-------------------------------+--------------------------------------------
 Reporter:  larsv              |          Owner:         
     Type:  bug                |         Status:  new    
 Priority:  normal             |      Milestone:  Not GHC
Component:  libraries/network  |        Version:  6.9    
 Severity:  normal             |     Resolution:         
 Keywords:                     |     Difficulty:  Unknown
 Testcase:                     |   Architecture:  x86    
       Os:  Windows            |  
-------------------------------+--------------------------------------------
Comment (by larsv):

 I modified Network/BSD.hs to trace out the h_addrtype variable in Storable
 HostEntry's peek, and it had the value 0x40002.
 The corresponding variable in the C struct should be a short, but is
 inferred to be CInt in the Haskell source, probably thanks to unpackFamily
 having type CInt -> Family.
 Due to that, it reads the family as an int, consuming the following length
 field as well.

 I hacked past this by giving the peek of h_addrtype an annotation of "::
 IO CShort" and adding a fromIntegral at the call to unpackFamily to
 convert it to the CInt that the unpackFamily function expects.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2250#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to