From 9073ad8f30d2555d0e70601538c7138aba6d7e58 Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 23 Jun 1999 15:30:59 +0000 Subject: [PATCH] [project @ 1999-06-23 15:30:59 by simonmar] print minInt as (mintInt+1)-1, to avoid gcc's conversion to unsigned. --- ghc/compiler/basicTypes/Const.lhs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 1.7.10.4