Skip to content

Commit

Permalink
target-ppc: Fix compiler warning
Browse files Browse the repository at this point in the history
gcc reports a warning which is usually wrong:

target-ppc/dfp_helper.c: In function ‘dfp_get_digit’:
target-ppc/dfp_helper.c:417:1: warning:
 control reaches end of non-void function [-Wreturn-type]

The compiler shows the warning if assert is not marked with the noreturn
attribute or if the code is compiled with -DNDEBUG.

Using g_assert_not_reached better documents the intention and does not
have these problems.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
stweil authored and Michael Tokarev committed Jun 24, 2014
1 parent e91c793 commit 0211b5c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions target-ppc/dfp_helper.c
Expand Up @@ -411,9 +411,8 @@ static inline int dfp_get_digit(decNumber *dn, int n)
return (dn->lsu[unit] / 10) % 10;
case 2:
return dn->lsu[unit] / 100;
default:
assert(0);
}
g_assert_not_reached();
}

#define DFP_HELPER_TAB(op, dnop, postprocs, size) \
Expand Down

0 comments on commit 0211b5c

Please sign in to comment.