[PATCH] D64379: [LLD] NFC: Fixed GCC warning in ELF/Arch/RISCV.cpp

Denis Bakhvalov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 8 16:25:00 PDT 2019


dendibakh created this revision.
dendibakh added a reviewer: MaskRay.
Herald added subscribers: llvm-commits, lenary, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, apazos, simoncook, johnrusso, rbar, asb, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

GCC emits warning on this line:
error: enumeral and non-enumeral type in conditional
expression [-Werror=extra]


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D64379

Files:
  lld/ELF/Arch/RISCV.cpp


Index: lld/ELF/Arch/RISCV.cpp
===================================================================
--- lld/ELF/Arch/RISCV.cpp
+++ lld/ELF/Arch/RISCV.cpp
@@ -176,7 +176,8 @@
 }
 
 RelType RISCV::getDynRel(RelType Type) const {
-  return Type == Target->SymbolicRel ? Type : R_RISCV_NONE;
+  return Type == Target->SymbolicRel ? Type
+                                     : static_cast<RelType>(R_RISCV_NONE);
 }
 
 RelExpr RISCV::getRelExpr(const RelType Type, const Symbol &S,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64379.208534.patch
Type: text/x-patch
Size: 476 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190708/b72f2ebb/attachment.bin>


More information about the llvm-commits mailing list