mirror of
git://sourceware.org/git/libabigail.git
synced 2025-02-27 19:30:45 +00:00
End all branches of get_soname() finish with a return statement
The compiler complains that there are some branches in the get_soname() function that don't end up with a return statement. For instance, there is no return statement right before the end of the function, in case the outermost for loop is not taken. This patch fixes that by having just one return statement at the end of the function. * tools/abipkgdiff.cc (get_soname): Have just one return statement at the end of this function. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
parent
ab548d0086
commit
9d25aa0125
@ -152,6 +152,8 @@ display_usage(const string& prog_name, ostream& out)
|
||||
string
|
||||
get_soname(Elf *elf, GElf_Ehdr *ehdr)
|
||||
{
|
||||
string result;
|
||||
|
||||
for (int i = 0; i < ehdr->e_phnum; ++i)
|
||||
{
|
||||
GElf_Phdr phdr_mem;
|
||||
@ -167,9 +169,7 @@ get_soname(Elf *elf, GElf_Ehdr *ehdr)
|
||||
assert (shdr == NULL || shdr->sh_type == SHT_DYNAMIC);
|
||||
Elf_Data *data = elf_getdata (scn, NULL);
|
||||
if (data == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
for (int cnt = 0; cnt < maxcnt; ++cnt)
|
||||
{
|
||||
@ -185,11 +185,14 @@ get_soname(Elf *elf, GElf_Ehdr *ehdr)
|
||||
continue;
|
||||
|
||||
// XXX Don't rely on SHDR
|
||||
return elf_strptr (elf, shdr->sh_link, dyn->d_un.d_val);
|
||||
result = elf_strptr (elf, shdr->sh_link, dyn->d_un.d_val);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user