Skip to content

Commit 5efec4a

Browse files
authored
Merge pull request #2322 from mazunki/fix-implicit-return
Fix warning related to implicit return
2 parents d361624 + 8165b3b commit 5efec4a

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

src/platform/x86_pc/ioapic.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ namespace x86
106106
}
107107
}
108108

109+
[[noreturn]] static void ioapic_panic(uint32_t entry) {
110+
printf("Entry: %u\n", entry);
111+
assert(0 && "Could not match I/O APIC to entry");
112+
std::abort();
113+
}
114+
109115
inline IOapic& get_ioapic_for(uint32_t entry)
110116
{
111117
uint32_t current = 0;
@@ -115,8 +121,7 @@ namespace x86
115121
}
116122
current += a.entries();
117123
}
118-
printf("Entry: %u\n", entry);
119-
assert(0 && "Could not match I/O APIC to entry");
124+
ioapic_panic(entry);
120125
}
121126

122127
void IOAPIC::enable(uint8_t cpu, const ACPI::override_t& redir)

vmbuild/elf_syms.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,13 @@ static int prune_elf_symbols(char* location)
206206
assert(hdr->e_ident[EI_MAG2] == ELFMAG2);
207207
assert(hdr->e_ident[EI_MAG3] == ELFMAG3);
208208

209-
if (hdr->e_ident[EI_CLASS] == ELFCLASS32)
210-
return prune_elf32_symbols(location);
211-
else if (hdr->e_ident[EI_CLASS] == ELFCLASS64)
212-
return prune_elf64_symbols(location);
213-
assert(0 && "Unknown ELF class");
209+
switch (hdr->e_ident[EI_CLASS]) {
210+
case ELFCLASS32:
211+
return prune_elf32_symbols(location);
212+
case ELFCLASS64:
213+
return prune_elf64_symbols(location);
214+
default:
215+
assert(false && "Unknown ELF class");
216+
return 0;
217+
}
214218
}

0 commit comments

Comments
 (0)