[lld] r238734 - COFF: Fix warnings found by gcc
Denis Protivensky
dprotivensky at accesssoftek.com
Mon Jun 1 02:26:33 PDT 2015
Author: denis-protivensky
Date: Mon Jun 1 04:26:32 2015
New Revision: 238734
URL: http://llvm.org/viewvc/llvm-project?rev=238734&view=rev
Log:
COFF: Fix warnings found by gcc
Modified:
lld/trunk/COFF/InputFiles.cpp
Modified: lld/trunk/COFF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.cpp?rev=238734&r1=238733&r2=238734&view=diff
==============================================================================
--- lld/trunk/COFF/InputFiles.cpp (original)
+++ lld/trunk/COFF/InputFiles.cpp Mon Jun 1 04:26:32 2015
@@ -127,7 +127,7 @@ std::error_code ObjectFile::initializeCh
if (Name == ".drectve") {
ArrayRef<uint8_t> Data;
COFFObj->getSectionContents(Sec, Data);
- Directives = StringRef((char *)Data.data(), Data.size()).trim();
+ Directives = StringRef((const char *)Data.data(), Data.size()).trim();
continue;
}
if (Name.startswith(".debug"))
@@ -201,7 +201,7 @@ SymbolBody *ObjectFile::createSymbolBody
}
if (IsFirst && AuxP) {
if (Chunk *C = SparseChunks[Sym.getSectionNumber()]) {
- auto *Aux = (coff_aux_section_definition *)AuxP;
+ auto *Aux = (coff_aux_section_definition *)const_cast<void *>(AuxP);
auto *Parent =
(SectionChunk *)(SparseChunks[Aux->getNumber(Sym.isBigObj())]);
if (Parent)
@@ -219,7 +219,7 @@ std::error_code ImportFile::parse() {
const auto *Hdr = reinterpret_cast<const coff_import_header *>(Buf);
// Check if the total size is valid.
- if (End - Buf != sizeof(*Hdr) + Hdr->SizeOfData) {
+ if ((size_t)(End - Buf) != (sizeof(*Hdr) + Hdr->SizeOfData)) {
llvm::errs() << "broken import library\n";
return make_error_code(LLDError::BrokenFile);
}
More information about the llvm-commits
mailing list