Skip to content

Commit 6c60ead

Browse files
authored
[NFC] Fix Werror=extra warning related to mismatched enum type (llvm#112808)
This is one of the many PRs to fix errors with LLVM_ENABLE_WERROR=on. Built by GCC 11. Fix warnings: llvm-project/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp: In member function ‘void llvm::AsmPrinter::emitJumpTableSizesSection(const llvm::MachineJumpTableInfo*, const llvm::Function&) const’: llvm-project/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:2852:31: error: enumerated and non-enumerated type in conditional expression [-Werror=extra] 2852 | int Flags = F.hasComdat() ? ELF::SHF_GROUP : 0; | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
1 parent a24a420 commit 6c60ead

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2849,7 +2849,7 @@ void AsmPrinter::emitJumpTableSizesSection(const MachineJumpTableInfo *MJTI,
28492849

28502850
if (isElf) {
28512851
MCSymbolELF *LinkedToSym = dyn_cast<MCSymbolELF>(CurrentFnSym);
2852-
int Flags = F.hasComdat() ? ELF::SHF_GROUP : 0;
2852+
int Flags = F.hasComdat() ? (unsigned)ELF::SHF_GROUP : 0;
28532853

28542854
JumpTableSizesSection = OutContext.getELFSection(
28552855
sectionName, ELF::SHT_LLVM_JT_SIZES, Flags, 0, GroupName, F.hasComdat(),

0 commit comments

Comments
 (0)