From: simonmar Date: Wed, 23 Jun 1999 15:30:59 +0000 (+0000) Subject: [project @ 1999-06-23 15:30:59 by simonmar] X-Git-Tag: Approximately_9120_patches~6101 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=9073ad8f30d2555d0e70601538c7138aba6d7e58 [project @ 1999-06-23 15:30:59 by simonmar] print minInt as (mintInt+1)-1, to avoid gcc's conversion to unsigned. --- diff --git a/ghc/compiler/basicTypes/Const.lhs b/ghc/compiler/basicTypes/Const.lhs index 7348a0d..2c2fbb4 100644 --- a/ghc/compiler/basicTypes/Const.lhs +++ b/ghc/compiler/basicTypes/Const.lhs @@ -346,8 +346,12 @@ pprLit lit <+> ppr range_max)]) -- in interface files, parenthesize raw negative ints. -- this avoids problems like {-1} being interpreted - -- as a comment starter. + -- as a comment starter. -} | ifaceStyle sty && i < 0 -> parens (integer i) + -- avoid a problem whereby gcc interprets the constant + -- minInt as unsigned. + | code_style && i == (toInteger (minBound :: Int)) + -> parens (hcat [integer (i+1), text "-1"]) | otherwise -> integer i where