Turned out to be a bootstrapping problem. WIth the first patch alex built fine and would generated warning free haskell code, but would error out if building itself.
Attached patch fixes the bootstrap problem. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
# Author : Erik de Castro Lopo <er...@mega-nerd.com> # Description : Fix generated haskell code so it doesn't fail with -Werror. # Debian Version : 2.3.5 # Date : Sun, 17 Apr 2011 15:45:41 +1000 Index: alex-2.3.5/templates/GenericTemplate.hs =================================================================== --- alex-2.3.5.orig/templates/GenericTemplate.hs +++ alex-2.3.5/templates/GenericTemplate.hs @@ -9,7 +9,7 @@ #ifdef ALEX_GHC #define ILIT(n) n# -#define FAST_INT_BINDING(n) (n) +#define FAST_INT_BINDING(n) (!(n)) #define IBOX(n) (I# (n)) #define FAST_INT Int# #define LT(n,m) (n <# m) @@ -57,10 +57,10 @@ ALEX_IF_BIGENDIAN narrow16Int# i where - i = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low) - high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#))) - low = int2Word# (ord# (indexCharOffAddr# arr off')) - off' = off *# 2# + !i = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low) + !high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#))) + !low = int2Word# (ord# (indexCharOffAddr# arr off')) + !off' = off *# 2# ALEX_ELSE indexInt16OffAddr# arr off ALEX_ENDIF @@ -74,14 +74,14 @@ ALEX_IF_BIGENDIAN narrow32Int# i where - i = word2Int# ((b3 `uncheckedShiftL#` 24#) `or#` + !i = word2Int# ((b3 `uncheckedShiftL#` 24#) `or#` (b2 `uncheckedShiftL#` 16#) `or#` (b1 `uncheckedShiftL#` 8#) `or#` b0) - b3 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 3#))) - b2 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 2#))) - b1 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#))) - b0 = int2Word# (ord# (indexCharOffAddr# arr off')) - off' = off *# 4# + !b3 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 3#))) + !b2 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 2#))) + !b1 = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#))) + !b0 = int2Word# (ord# (indexCharOffAddr# arr off')) + !off' = off *# 4# ALEX_ELSE indexInt32OffAddr# arr off ALEX_ENDIF Index: alex-2.3.5/src/Scan.x =================================================================== --- alex-2.3.5.orig/src/Scan.x +++ alex-2.3.5/src/Scan.x @@ -11,7 +11,7 @@ ------------------------------------------------------------------------------- { -{-# OPTIONS_GHC -w #-} +{-# OPTIONS_GHC -w -XBangPatterns #-} module Scan(lexer, AlexPosn(..), Token(..), Tkn(..), tokPosn) where