[lld] 38b20a0 - [ELF] Fix std::min error on MacOs

Alex Brachet via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 22 12:03:34 PDT 2022


Author: Alex Brachet
Date: 2022-09-22T19:03:13Z
New Revision: 38b20a02fe6798e9788dc012910784255500f427

URL: https://github.com/llvm/llvm-project/commit/38b20a02fe6798e9788dc012910784255500f427
DIFF: https://github.com/llvm/llvm-project/commit/38b20a02fe6798e9788dc012910784255500f427.diff

LOG: [ELF] Fix std::min error on MacOs

Added: 
    

Modified: 
    lld/ELF/OutputSections.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index a5a6d60221044..a2ba9e5735b9e 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -362,7 +362,7 @@ template <class ELFT> void OutputSection::maybeCompress() {
     ZSTD_EndDirective directive = ZSTD_e_continue;
     const size_t blockSize = ZSTD_CStreamInSize();
     do {
-      const size_t n = std::min(size - pos, blockSize);
+      const size_t n = std::min(static_cast<size_t>(size - pos), blockSize);
       if (n == size - pos)
         directive = ZSTD_e_end;
       ZSTD_inBuffer zib = {buf.get() + pos, n, 0};


        


More information about the llvm-commits mailing list