From: Simon Pilgrim Date: Wed, 4 Sep 2019 12:51:40 +0000 (+0000) Subject: Fix "enumeral and non-enumeral type in conditional expression" warnings. NFCI. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43264f371c5fe5875c0c6ecd8dea3934052fdb4d;p=llvm Fix "enumeral and non-enumeral type in conditional expression" warnings. NFCI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370892 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm-objcopy/CopyConfig.cpp b/tools/llvm-objcopy/CopyConfig.cpp index 9591e5aeb77..b3a62a3a6d5 100644 --- a/tools/llvm-objcopy/CopyConfig.cpp +++ b/tools/llvm-objcopy/CopyConfig.cpp @@ -716,7 +716,7 @@ Expected parseObjcopyOptions(ArrayRef ArgsArr) { for (auto Arg : InputArgs.filtered(OBJCOPY_add_symbol)) { Expected NSI = parseNewSymbolInfo( Arg->getValue(), - Config.NewSymbolVisibility.getValueOr(ELF::STV_DEFAULT)); + Config.NewSymbolVisibility.getValueOr((uint8_t)ELF::STV_DEFAULT)); if (!NSI) return NSI.takeError(); Config.SymbolsToAdd.push_back(*NSI); diff --git a/tools/llvm-objcopy/ELF/ELFObjcopy.cpp b/tools/llvm-objcopy/ELF/ELFObjcopy.cpp index fa79b609381..bd49426f9d1 100644 --- a/tools/llvm-objcopy/ELF/ELFObjcopy.cpp +++ b/tools/llvm-objcopy/ELF/ELFObjcopy.cpp @@ -756,7 +756,7 @@ Error executeObjcopyOnIHex(const CopyConfig &Config, MemoryBuffer &In, Error executeObjcopyOnRawBinary(const CopyConfig &Config, MemoryBuffer &In, Buffer &Out) { uint8_t NewSymbolVisibility = - Config.NewSymbolVisibility.getValueOr(ELF::STV_DEFAULT); + Config.NewSymbolVisibility.getValueOr((uint8_t)ELF::STV_DEFAULT); BinaryReader Reader(Config.BinaryArch, &In, NewSymbolVisibility); std::unique_ptr Obj = Reader.create();