[lld] 7438dbe - [ELF] Cast size to size_t. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 25 22:38:29 PST 2022
Author: Fangrui Song
Date: 2022-01-25T22:38:24-08:00
New Revision: 7438dbe078c654677e83a126ae07af4c463ed764
URL: https://github.com/llvm/llvm-project/commit/7438dbe078c654677e83a126ae07af4c463ed764
DIFF: https://github.com/llvm/llvm-project/commit/7438dbe078c654677e83a126ae07af4c463ed764.diff
LOG: [ELF] Cast size to size_t. NFC
To fix
../../chromeclang/bin/../include/c++/v1/__algorithm/min.h:39:1: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('unsigned long' vs. 'unsigned long long')
on macOS arm64.
Added:
Modified:
lld/ELF/OutputSections.cpp
Removed:
################################################################################
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index f01f74f44d22..e97d23798d03 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -351,7 +351,7 @@ template <class ELFT> void OutputSection::maybeCompress() {
const size_t numShards = (size + shardSize - 1) / shardSize;
auto shardsIn = std::make_unique<ArrayRef<uint8_t>[]>(numShards);
for (size_t i = 0, start = 0, end; start != size; ++i, start = end) {
- end = std::min(start + shardSize, size);
+ end = std::min(start + shardSize, (size_t)size);
shardsIn[i] = makeArrayRef<uint8_t>(buf.get() + start, end - start);
}
More information about the llvm-commits
mailing list