diff --git a/lld/MachO/SyntheticSections.cpp b/lld/MachO/SyntheticSections.cpp index 28fb8047cacd9..417b7cf93efa7 100644 --- a/lld/MachO/SyntheticSections.cpp +++ b/lld/MachO/SyntheticSections.cpp @@ -2079,12 +2079,12 @@ void ObjCMethListSection::finalize() { void ObjCMethListSection::writeTo(uint8_t *bufStart) const { uint8_t *buf = bufStart; for (const ConcatInputSection *isec : inputs) { - assert(buf - bufStart == long(isec->outSecOff) && + assert(buf - bufStart == std::ptrdiff_t(isec->outSecOff) && "Writing at unexpected offset"); uint32_t writtenSize = writeRelativeMethodList(isec, buf); buf += writtenSize; } - assert(buf - bufStart == sectionSize && + assert(buf - bufStart == std::ptrdiff_t(sectionSize) && "Written size does not match expected section size"); }