[cfe-commits] [PATCH 2/2] Fix signed/unsigned Compare
David Greene
dag at cray.com
Tue Jan 8 13:21:39 PST 2013
Do some casting to avoid a signed/unsigned compare.
---
.../clang/lib/CodeGen/CGRecordLayoutBuilder.cpp | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp b/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
index 1d7271d..02920cd 100644
--- a/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
+++ b/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
@@ -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 &&
--
1.7.8.4
More information about the cfe-commits
mailing list