[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;
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
Mikael Holmen 2021-03-03 10:17:42 +01:00
parent 3b47bd32f9
commit 85b67d5fa9
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}