From 85b67d5fa92dceac2861c64ffedc02eb114f839d Mon Sep 17 00:00:00 2001 From: Mikael Holmen Date: Wed, 3 Mar 2021 10:17:42 +0100 Subject: [PATCH] [lld][MachO] Silence "enumeral and non-enumeral type" warning from gcc gcc complained with [1110/1140] Building CXX object tools/lld/MachO/CMakeFiles/lldMachO2.dir/SyntheticSections.cpp.o ../../lld/MachO/SyntheticSections.cpp: In function 'int16_t ordinalForDylibSymbol(const lld::macho::DylibSymbol&)': ../../lld/MachO/SyntheticSections.cpp:287:14: warning: enumeral and non-enumeral type in conditional expression [-Wextra] 286 | return config->namespaceKind == NamespaceKind::flat || dysym.isDynamicLookup() | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 287 | ? MachO::BIND_SPECIAL_DYLIB_FLAT_LOOKUP | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 288 | : dysym.getFile()->ordinal; | ~~~~~~~~~~~~~~~~~~~~~~~~~~ --- lld/MachO/SyntheticSections.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lld/MachO/SyntheticSections.cpp b/lld/MachO/SyntheticSections.cpp index 27c0996..7f5b0a5 100644 --- a/lld/MachO/SyntheticSections.cpp +++ b/lld/MachO/SyntheticSections.cpp @@ -284,7 +284,7 @@ static void encodeBinding(const Symbol *sym, const OutputSection *osec, // Non-weak bindings need to have their dylib ordinal encoded as well. static int16_t ordinalForDylibSymbol(const DylibSymbol &dysym) { return config->namespaceKind == NamespaceKind::flat || dysym.isDynamicLookup() - ? MachO::BIND_SPECIAL_DYLIB_FLAT_LOOKUP + ? (int16_t)MachO::BIND_SPECIAL_DYLIB_FLAT_LOOKUP : dysym.getFile()->ordinal; } -- 2.7.4