"warning: cast to pointer from integer of different size"

Ian Lynagh igloo at earth.li
Thu Jan 5 18:33:12 EST 2006


On Debian Linux/amd64 with

    gcc version 4.0.3 20051201 (prerelease) (Debian 4.0.2-5)

and this module:

--------------------------------
module Q where

import Char (chr, digitToInt)

hexToChar :: Char -> Char -> Char
hexToChar x y = chr (digitToInt x + digitToInt y)
--------------------------------

I get:

$ rm Q.o; ghc -O -fglasgow-exts -c Q.hs
/tmp/ghc29650.hc: In function #s1zC_ret#:
/tmp/ghc29650.hc:36: warning: cast to pointer from integer of different size
$ rm Q.o; ghc-cvs -O -fglasgow-exts -c Q.hs
/tmp/ghc29656_0.hc: In function #svJ_ret#:

/tmp/ghc29656_0.hc:34:0:
     warning: cast to pointer from integer of different size
$


Likewise, with this module:

--------------------------------
module Q where

import GHC.Exts
import Char ( chr )

data FastString = FastString Int# ByteArray# 
                | UnicodeStr [Int]

headFS :: FastString -> Char
headFS (FastString l# ba#) = 
 if l# ># 0# then C# (indexCharArray# ba# 0#) else 'c'
headFS (UnicodeStr (c:_)) = chr c
headFS (UnicodeStr _) = 'c'
--------------------------------

I get:

$ rm Q.o; ghc -O -fglasgow-exts -c Q.hs
/tmp/ghc29165.hc: In function #s1xH_ret#:
/tmp/ghc29165.hc:33: warning: cast to pointer from integer of different size
$ rm Q.o; ghc-cvs -O -fglasgow-exts -c Q.hs
/tmp/ghc29171_0.hc: In function #seM_ret#:

/tmp/ghc29171_0.hc:31:0:
     warning: cast to pointer from integer of different size
$


Thanks
Ian




More information about the Glasgow-haskell-bugs mailing list