1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[MC][ELF] Fix "enumeral and non-enumeral type in conditional expression" warning (NFC)

GCC warning:
```
/llvm-project/llvm/lib/MC/ELFObjectWriter.cpp: In member function ‘void {anonymous}::ELFWriter::writeHeader(const llvm::MCAssembler&)’:
/llvm-project/llvm/lib/MC/ELFObjectWriter.cpp:421:20: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
  420 |   W.OS << char(OSABI == ELF::ELFOSABI_NONE && OWriter.seenGnuAbi()
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  421 |                    ? ELF::ELFOSABI_GNU
      |                    ^~~~~~~~~~~~~~~~~~~
  422 |                    : OSABI);
      |                    ~~~~~~~
```
This commit is contained in:
Yang Fan 2021-03-10 11:26:39 +08:00
parent 7bfe628a33
commit d5417396f4

View File

@ -418,7 +418,7 @@ void ELFWriter::writeHeader(const MCAssembler &Asm) {
// e_ident[EI_OSABI]
uint8_t OSABI = OWriter.TargetObjectWriter->getOSABI();
W.OS << char(OSABI == ELF::ELFOSABI_NONE && OWriter.seenGnuAbi()
? ELF::ELFOSABI_GNU
? int(ELF::ELFOSABI_GNU)
: OSABI);
// e_ident[EI_ABIVERSION]
W.OS << char(OWriter.TargetObjectWriter->getABIVersion());