[lld] r340164 - [LLD][ELF] - Fix warning.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 20 03:29:21 PDT 2018


Author: grimar
Date: Mon Aug 20 03:29:21 2018
New Revision: 340164

URL: http://llvm.org/viewvc/llvm-project?rev=340164&view=rev
Log:
[LLD][ELF] - Fix warning.

This fixes the following warning when compiling with gcc version 8.0.1 20180319 (experimental) (GCC):

/home/umb/LLVM/llvm/tools/lld/ELF/SyntheticSections.cpp:1951:46: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
     return OS->SectionIndex >= SHN_LORESERVE ? SHN_XINDEX : OS->SectionIndex;

Modified:
    lld/trunk/ELF/SyntheticSections.cpp

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=340164&r1=340163&r2=340164&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Mon Aug 20 03:29:21 2018
@@ -1948,7 +1948,8 @@ static uint32_t getSymSectionIndex(Symbo
   if (!isa<Defined>(Sym) || Sym->NeedsPltAddr)
     return SHN_UNDEF;
   if (const OutputSection *OS = Sym->getOutputSection())
-    return OS->SectionIndex >= SHN_LORESERVE ? SHN_XINDEX : OS->SectionIndex;
+    return OS->SectionIndex >= SHN_LORESERVE ? (uint32_t)SHN_XINDEX
+                                             : OS->SectionIndex;
   return SHN_ABS;
 }
 




More information about the llvm-commits mailing list