[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PULL 04/14] target-ppc: Fix compiler warning
From: |
Michael Tokarev |
Subject: |
[Qemu-trivial] [PULL 04/14] target-ppc: Fix compiler warning |
Date: |
Tue, 24 Jun 2014 20:09:10 +0400 |
From: Stefan Weil <address@hidden>
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 <address@hidden>
Reviewed-by: Alexander Graf <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
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();
}
#define DFP_HELPER_TAB(op, dnop, postprocs, size)
\
--
1.7.10.4
- [Qemu-trivial] [PULL 01/14] virtio-serial: remove useless set_config function, (continued)
- [Qemu-trivial] [PULL 01/14] virtio-serial: remove useless set_config function, Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 07/14] rng-random: NULL check not needed before g_free(), Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 03/14] configure: Enable TPM by default, add --disable-tpm, Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 14/14] Add support for the arm breakpoint syscall, Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 12/14] target-s390x: Remove unused ld_code6() function, Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 08/14] tcg: mark tcg_out* and tcg_patch* with attribute 'unused', Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 13/14] Increase maximum number of session of the internal TFTP server., Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 10/14] target-unicore: Remove unused functions, Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 05/14] vscclient: Add required headers to fix build on FreeBSD, Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 09/14] build-sys: introduce install-prog macro to install&strip binaries and use it, Michael Tokarev, 2014/06/24
- [Qemu-trivial] [PULL 04/14] target-ppc: Fix compiler warning,
Michael Tokarev <=
- [Qemu-trivial] [PULL 11/14] hw/moxie/moxiesim.c: Remove unused moxie_intc_create(), Michael Tokarev, 2014/06/24
- Re: [Qemu-trivial] [Qemu-devel] [PULL 00/14] Trivial patches for 2014-06-24, Peter Maydell, 2014/06/24