[lld] Fix warning in lld/Macho while building lld for wasm (PR #120889)

Carlo Cabrera via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 22 04:21:11 PST 2024


================
@@ -2084,7 +2084,7 @@ void ObjCMethListSection::writeTo(uint8_t *bufStart) const {
     uint32_t writtenSize = writeRelativeMethodList(isec, buf);
     buf += writtenSize;
   }
-  assert(buf - bufStart == sectionSize &&
+  assert(buf - bufStart == long(sectionSize) &&
----------------
carlocab wrote:

```suggestion
  assert(buf - bufStart == std::ptrdiff_t(sectionSize) &&
```
Seems more correct? Same for the `assert` above.

https://github.com/llvm/llvm-project/pull/120889


More information about the llvm-commits mailing list