From: David Greene Date: Tue, 15 Jan 2013 23:13:47 +0000 (+0000) Subject: Avoid unsigned Compare to int X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cc41a94688615b551505e0e7c287e1c444f53a3f;p=clang Avoid unsigned Compare to int Cast arithmetic results to avoid comparison of an unsigned to an int. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172570 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index dd248e1900..85adf35961 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1191,7 +1191,7 @@ RValue CodeGenFunction::EmitLoadOfBitfieldLValue(LValue LV) { cast(Val)->setAlignment(Info.StorageAlignment); if (Info.IsSigned) { - assert((Info.Offset + Info.Size) <= Info.StorageSize); + assert(static_cast(Info.Offset + Info.Size) <= Info.StorageSize); unsigned HighBits = Info.StorageSize - Info.Offset - Info.Size; if (HighBits) Val = Builder.CreateShl(Val, HighBits, "bf.shl");