From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwx1o-0006bt-CA for qemu-devel@nongnu.org; Tue, 17 Jun 2014 13:18:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wwx1l-0004Oh-33 for qemu-devel@nongnu.org; Tue, 17 Jun 2014 13:18:36 -0400 From: Stefan Weil Date: Tue, 17 Jun 2014 19:18:28 +0200 Message-Id: <1403025508-19171-1-git-send-email-sw@weilnetz.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] target-ppc: Fix compiler warning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Stefan Weil , qemu-ppc@nongnu.org, Alexander Graf gcc reports a warning which is usually wrong: target-ppc/dfp_helper.c: In function =E2=80=98dfp_get_digit=E2=80=99: 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 --- target-ppc/dfp_helper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target-ppc/dfp_helper.c b/target-ppc/dfp_helper.c index 773803a..49820bf 100644 --- a/target-ppc/dfp_helper.c +++ b/target-ppc/dfp_helper.c @@ -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(); } =20 #define DFP_HELPER_TAB(op, dnop, postprocs, size) = \ --=20 1.7.10.4