Skip to content

Commit 4edced7

Browse files
committed
fix: return on end-of-fuction [-Wreturn-type]
1 parent ea7a074 commit 4edced7

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

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)