]> granicus.if.org Git - clang/commitdiff
Fix signed/unsigned Compare
authorDavid Greene <greened@obbligato.org>
Tue, 15 Jan 2013 23:13:49 +0000 (23:13 +0000)
committerDavid Greene <greened@obbligato.org>
Tue, 15 Jan 2013 23:13:49 +0000 (23:13 +0000)
Do some casting to avoid a signed/unsigned compare.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172571 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGRecordLayoutBuilder.cpp

index 1d7271d6a456b31bd0963c9179a545a18a5fb73b..02920cd9b66bc1e6a64dc75165e34d3a12e4174b 100644 (file)
@@ -1075,7 +1075,8 @@ CGRecordLayout *CodeGenTypes::ComputeRecordLayout(const RecordDecl *D,
       // the size + offset should match the storage size in that case as it
       // "starts" at the back.
       if (getDataLayout().isBigEndian())
-        assert((Info.Offset + Info.Size) == Info.StorageSize &&
+        assert(static_cast<unsigned>(Info.Offset + Info.Size) ==
+               Info.StorageSize &&
                "Big endian union bitfield does not end at the back");
       else
         assert(Info.Offset == 0 &&