forked from OSchip/llvm-project
[lld][ELF] Fix "enumeral and non-enumeral type in conditional expression" warning (NFC)
GCC warning:
```
/llvm-project/lld/ELF/SyntheticSections.cpp: In member function ‘virtual void lld:🧝:VersionTableSection::writeTo(uint8_t*)’:
/llvm-project/lld/ELF/SyntheticSections.cpp:3128:34: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
3128 | write16(buf, s.sym->isLazy() ? VER_NDX_GLOBAL : s.sym->versionId);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
This commit is contained in:
parent
4307446e9f
commit
c09277b0d8
|
@ -3125,7 +3125,8 @@ void VersionTableSection::writeTo(uint8_t *buf) {
|
|||
for (const SymbolTableEntry &s : getPartition().dynSymTab->getSymbols()) {
|
||||
// Use the original versionId for an unfetched lazy symbol (undefined weak),
|
||||
// which must be VER_NDX_GLOBAL (an undefined versioned symbol is an error).
|
||||
write16(buf, s.sym->isLazy() ? VER_NDX_GLOBAL : s.sym->versionId);
|
||||
write16(buf, s.sym->isLazy() ? static_cast<uint16_t>(VER_NDX_GLOBAL)
|
||||
: s.sym->versionId);
|
||||
buf += 2;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue