From 3ae27fca7ea584222bb93019d12bc79f2ada64f0 Mon Sep 17 00:00:00 2001 From: Yang Fan Date: Thu, 18 Feb 2021 14:57:45 +0800 Subject: [PATCH] [MC][ELF] Fix gcc "enumeral and non-enumeral type in conditional expression" warning (NFC) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC warning: ``` /llvm-project/llvm/lib/MC/ELFObjectWriter.cpp: In member function ‘uint64_t {anonymous}::ELFWriter::writeObject(llvm::MCAssembler&, const llvm::MCAsmLayout&)’: /llvm-project/llvm/lib/MC/ELFObjectWriter.cpp:1137:38: warning: enumeral and non-enumeral type in conditional expression [-Wextra] 1137 | write(uint32_t(Group->isComdat() ? ELF::GRP_COMDAT : 0)); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ ``` --- llvm/lib/MC/ELFObjectWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp index b99fce330c28..f6b015f7c560 100644 --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/lib/MC/ELFObjectWriter.cpp @@ -1134,7 +1134,7 @@ uint64_t ELFWriter::writeObject(MCAssembler &Asm, const MCAsmLayout &Layout) { const MCSymbol *SignatureSymbol = Group->getGroup(); assert(SignatureSymbol); - write(uint32_t(Group->isComdat() ? ELF::GRP_COMDAT : 0)); + write(uint32_t(Group->isComdat() ? unsigned(ELF::GRP_COMDAT) : 0)); for (const MCSectionELF *Member : GroupMembers[SignatureSymbol]) { uint32_t SecIndex = SectionIndexMap.lookup(Member); write(SecIndex);