[lld] 3b912a9 - [lld] Fix a warning

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 30 13:28:06 PDT 2022


Author: Kazu Hirata
Date: 2022-10-30T13:28:00-07:00
New Revision: 3b912a9ffdae3bf4d2224ff1b668f645fa14418b

URL: https://github.com/llvm/llvm-project/commit/3b912a9ffdae3bf4d2224ff1b668f645fa14418b
DIFF: https://github.com/llvm/llvm-project/commit/3b912a9ffdae3bf4d2224ff1b668f645fa14418b.diff

LOG: [lld] Fix a warning

This patch fixes:

  lld/MachO/OutputSegment.cpp:50:43: warning: enumerated and
  non-enumerated type in conditional expression [-Wextra]

Added: 
    

Modified: 
    lld/MachO/OutputSegment.cpp

Removed: 
    


################################################################################
diff  --git a/lld/MachO/OutputSegment.cpp b/lld/MachO/OutputSegment.cpp
index fa56c1314fff..be541d29f19e 100644
--- a/lld/MachO/OutputSegment.cpp
+++ b/lld/MachO/OutputSegment.cpp
@@ -47,7 +47,7 @@ static uint32_t maxProt(StringRef name) {
 static uint32_t flags(StringRef name) {
   // If we ever implement shared cache output support, SG_READ_ONLY should not
   // be used for dylibs that can be placed in it.
-  return name == segment_names::dataConst ? SG_READ_ONLY : 0;
+  return name == segment_names::dataConst ? (uint32_t)SG_READ_ONLY : 0;
 }
 
 size_t OutputSegment::numNonHiddenSections() const {


        


More information about the llvm-commits mailing list