[clang] f5b93ae - [clang] Fix -Wsign-compare in 32-bit builds
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Sat Jun 22 13:40:10 PDT 2024
Author: Fangrui Song
Date: 2024-06-22T13:40:05-07:00
New Revision: f5b93ae5884dd72bd145576344e4effff685cf5e
URL: https://github.com/llvm/llvm-project/commit/f5b93ae5884dd72bd145576344e4effff685cf5e
DIFF: https://github.com/llvm/llvm-project/commit/f5b93ae5884dd72bd145576344e4effff685cf5e.diff
LOG: [clang] Fix -Wsign-compare in 32-bit builds
Added:
Modified:
clang/lib/Frontend/TextDiagnostic.cpp
clang/lib/Lex/PPDirectives.cpp
Removed:
################################################################################
diff --git a/clang/lib/Frontend/TextDiagnostic.cpp b/clang/lib/Frontend/TextDiagnostic.cpp
index 10240d7ee6f2e..a264836a54398 100644
--- a/clang/lib/Frontend/TextDiagnostic.cpp
+++ b/clang/lib/Frontend/TextDiagnostic.cpp
@@ -145,7 +145,7 @@ printableTextForNextCharacter(StringRef SourceLine, size_t *I,
(void)Res;
assert(Res == llvm::conversionOK);
assert(OriginalBegin < Begin);
- assert((Begin - OriginalBegin) == CharSize);
+ assert(unsigned(Begin - OriginalBegin) == CharSize);
(*I) += (Begin - OriginalBegin);
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 94410bc7e078a..a53540b12dee6 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -546,7 +546,7 @@ void Preprocessor::SkipExcludedConditionalBlock(SourceLocation HashTokenLoc,
if (!*SkipRangePtr) {
*SkipRangePtr = Hashptr - BeginPtr;
}
- assert(*SkipRangePtr == Hashptr - BeginPtr);
+ assert(*SkipRangePtr == unsigned(Hashptr - BeginPtr));
BeginPtr = nullptr;
SkipRangePtr = nullptr;
}
More information about the cfe-commits
mailing list