diff --git a/llvm/lib/ObjCopy/MachO/MachOReader.cpp b/llvm/lib/ObjCopy/MachO/MachOReader.cpp index 2cbffc12adbf76..9006f9e6d98d95 100644 --- a/llvm/lib/ObjCopy/MachO/MachOReader.cpp +++ b/llvm/lib/ObjCopy/MachO/MachOReader.cpp @@ -67,7 +67,7 @@ Expected>> static extractSections( LoadCmd.C.cmdsize); Curr < End; ++Curr) { SectionType Sec; - memcpy((void *)&Sec, Curr, sizeof(SectionType)); + memcpy((void *)&Sec, reinterpret_cast(Curr), sizeof(SectionType)); if (MachOObj.isLittleEndian() != sys::IsLittleEndianHost) MachO::swapStruct(Sec);