From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L67aa-0000cX-LB for qemu-devel@nongnu.org; Fri, 28 Nov 2008 12:57:12 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L67aZ-0000cL-4H for qemu-devel@nongnu.org; Fri, 28 Nov 2008 12:57:12 -0500 Received: from [199.232.76.173] (port=50735 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L67aY-0000cI-Tf for qemu-devel@nongnu.org; Fri, 28 Nov 2008 12:57:10 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:51347) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L67aY-0000Q8-6B for qemu-devel@nongnu.org; Fri, 28 Nov 2008 12:57:10 -0500 Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166]) by fmmailgate03.web.de (Postfix) with ESMTP id BBE44F4EA959 for ; Fri, 28 Nov 2008 18:57:04 +0100 (CET) Received: from [88.64.25.231] (helo=[192.168.1.197]) by smtp05.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.109 #226) id 1L67aR-00079J-00 for qemu-devel@nongnu.org; Fri, 28 Nov 2008 18:57:04 +0100 Message-ID: <493030EA.4040405@web.de> Date: Fri, 28 Nov 2008 18:56:58 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <492FDA5D.6080602@siemens.com> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigE23F8FD9F8920F26EA7482C5" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH 2/2] Add __noreturn function attribute Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigE23F8FD9F8920F26EA7482C5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable malc wrote: > On Fri, 28 Nov 2008, Jan Kiszka wrote: >=20 >> Introduce __noreturn attribute and attach it to cpu_loop_exit as well = as >> interrupt/exception helpers for i386. This avoids a bunch of gcc4 >> warnings. >=20 > ISO/IEC 9899:1990 >=20 > 7.1.3 > -- All identifiers that begin with an underscore and > either an uppercase letter or another underscore are > always reserved for any use. =2E..but commonly used in practice (which is no excuse to do so here, jus= t an explanation). Given that we have __hidden already, I just followed the existing pattern.=20 >=20 > Breaking the standard is what brings us the joys of recently (re)posted= > patch for NetBSD and [u]intXX fun. I have no problem with calling it 'noreturn' instead. Jan -----------> Introduce noreturn attribute and attach it to cpu_loop_exit as well as interrupt/exception helpers for i386. This avoids a bunch of gcc4 warnings. Signed-off-by: Jan Kiszka --- exec-all.h | 5 ++++- target-i386/exec.h | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/exec-all.h b/exec-all.h index ca97f57..4934932 100644 --- a/exec-all.h +++ b/exec-all.h @@ -20,6 +20,9 @@ =20 #ifndef _EXEC_ALL_H_ #define _EXEC_ALL_H_ + +#define noreturn __attribute__ ((__noreturn__)) + /* allow to see translation results - the slowdown should be negligible,= so we leave it */ #define DEBUG_DISAS =20 @@ -82,7 +85,7 @@ TranslationBlock *tb_gen_code(CPUState *env, target_ulong pc, target_ulong cs_base, int= flags, int cflags); void cpu_exec_init(CPUState *env); -void cpu_loop_exit(void); +void noreturn cpu_loop_exit(void); int page_unprotect(target_ulong address, unsigned long pc, void *puc); void tb_invalidate_phys_page_range(target_phys_addr_t start, target_phys= _addr_t end, int is_cpu_write_access); diff --git a/target-i386/exec.h b/target-i386/exec.h index 3663166..b35f08b 100644 --- a/target-i386/exec.h +++ b/target-i386/exec.h @@ -67,10 +67,10 @@ void do_interrupt(int intno, int is_int, int error_co= de, target_ulong next_eip, int is_hw); void do_interrupt_user(int intno, int is_int, int error_code, target_ulong next_eip); -void raise_interrupt(int intno, int is_int, int error_code, - int next_eip_addend); -void raise_exception_err(int exception_index, int error_code); -void raise_exception(int exception_index); +void noreturn raise_interrupt(int intno, int is_int, int error_code, + int next_eip_addend); +void noreturn raise_exception_err(int exception_index, int error_code); +void noreturn raise_exception(int exception_index); void do_smm_enter(void); =20 /* n must be a constant to be efficient */ --------------enigE23F8FD9F8920F26EA7482C5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkkwMO8ACgkQniDOoMHTA+n95QCeLLFSEpoNvuVnlhHTiOtArmK8 YXIAoIDdChLhqgwEguMSpdfOoGtZuaH2 =j0Qe -----END PGP SIGNATURE----- --------------enigE23F8FD9F8920F26EA7482C5--