> I'm not sure if the following is harmless or not: Under some rare
> circumstances I get warnings of the following form:
> 
>    marutea examples/misc> ghc 
> -i/home/inst/panne/forschung/haskell/HOpenGL/lib 
> -I/home/inst/panne/forschung/haskell/HOpenGL/lib -syslib 
> posix -fglasgow-exts -recomp -Wall -O -c BspTree.hs -keep-hc-file-too
>    ghc: module version changed to 2; reason: usages changed
>    /tmp/ghc15974.hc:9889: warning: decimal constant is so 
> large that it is unsigned
>   /tmp/ghc15974.hc:9906: warning: decimal constant is so 
> large that it is unsigned
> 
> The following two lines from the .hc file provoke the above warnings:
> 
>    
> INFO_TABLE_SRT_BITMAP(c7b7_info,c7b7_ret,-2147483648,BspTree_z
> dwreadBspTree_srt,31,42,RET_SMALL,static ,IF_,0,0);
>    
> INFO_TABLE_SRT_BITMAP(c7b6_info,c7b6_ret,-2147483648,BspTree_z
> dwreadBspTree_srt,31,43,RET_SMALL,static ,IF_,0,0);
> 
> -2147483648 doesn't seem to be a nice value for an StgWord32...  :-}

It's a perfectly reasonable value for an StgWord32, but gcc is following the
letter of the ANSI C spec here and refusing to accept it just in case the
target architecture is using one's complement instead of two's complement
(yeah, right :).

The fix in general is to code this constant as -2147483647-1.  Check your
/usr/include/limits.h, you'll probably see the same trick.

Could you try the patch below and see if that fixes it?  Cheers.

*** PprAbsC.lhs 1999/07/14 14:40:21     1.39
--- PprAbsC.lhs 1999/10/11 09:39:54
***************
*** 1205,1212 ****
  pp_liveness :: Liveness -> SDoc
  pp_liveness lv = 
     case lv of
-       LvSmall mask -> int (intBS mask)
        LvLarge lbl  -> char '&' <> pprCLabel lbl
  \end{code}
  
  %************************************************************************
--- 1205,1216 ----
  pp_liveness :: Liveness -> SDoc
  pp_liveness lv = 
     case lv of
        LvLarge lbl  -> char '&' <> pprCLabel lbl
+       LvSmall mask
+          | bitmap_int == (minBound :: Int) -> int (bitmap_int+1) <> text
"-1"
+          | otherwise -> int bitmap_int
+          where
+          bitmap_int = intBS mask
  \end{code}
  
  %************************************************************************

Reply via email to