From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlCqe-0002AG-1H for qemu-devel@nongnu.org; Mon, 03 Nov 2014 03:18:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlCqS-00005A-KK for qemu-devel@nongnu.org; Mon, 03 Nov 2014 03:18:47 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:24505) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlCqS-00004v-7J for qemu-devel@nongnu.org; Mon, 03 Nov 2014 03:18:36 -0500 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NEG000CYF2XGO90@mailout3.samsung.com> for qemu-devel@nongnu.org; Mon, 03 Nov 2014 17:18:33 +0900 (KST) From: SeokYeon Hwang References: <1414731561-13391-1-git-send-email-syeon.hwang@samsung.com> In-reply-to: Date: Mon, 03 Nov 2014 17:18:35 +0900 Message-id: <00d701cff73e$c395a130$4ac0e390$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: quoted-printable Content-language: ko Subject: Re: [Qemu-devel] [PATCH] translate-all: wrapped map_exec() in #ifdef List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Peter Maydell' Cc: 'QEMU Developers' I posted a new patch which your suggestion is applied. Thanks. > -----Original Message----- > From: Peter Maydell [mailto:peter.maydell@linaro.org] > Sent: Saturday, November 01, 2014 3:30 AM > To: SeokYeon Hwang > Cc: QEMU Developers > Subject: Re: [Qemu-devel] [PATCH] translate-all: wrapped map_exec() in > #ifdef >=20 > On 31 October 2014 04:59, SeokYeon Hwang = wrote: > > Moved map_exec() and wrapped it in #ifdef to avoid = "-Wunused-function" > on clang 3.4 or later. > > > > Signed-off-by: SeokYeon Hwang >=20 > I had this kind of on my todo list too, but I didn't much like the = nested > ifdefs which are really only because of what the different = implementations > of alloc_code_gen_buffer() happen to do. I think it would be more = robust > to just mark the functions with the 'unused' attribute instead of = relying > on 'inline' to implicitly do this for us: >=20 > --- a/translate-all.c > +++ b/translate-all.c > @@ -270,14 +270,14 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t > retaddr) } >=20 > #ifdef _WIN32 > -static inline void map_exec(void *addr, long size) > +static __attribute__((unused)) void map_exec(void *addr, long size) > { > DWORD old_protect; > VirtualProtect(addr, size, > PAGE_EXECUTE_READWRITE, &old_protect); } #else = -static > inline void map_exec(void *addr, long size) > +static __attribute__((unused)) void map_exec(void *addr, long size) > { > unsigned long start, end, page_size; >=20 > thanks > -- PMM