translate-all: Mark map_exec() with the 'unused' attribute
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 23 Dec 2014 22:26:54 +0000 (22:26 +0000)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 2 Jun 2015 03:09:17 +0000 (12:09 +0900)
Mark map_exec() with the 'unused' attribute to avoid '-Wunused-function'
warnings on clang 3.4 or later. This means we don't need to mark it
'inline', which is what we were previously using to suppress the warning
(a trick which only works with gcc, not clang).

Change-Id: Ic9faa221ff73082c6b15e68bdef31cc9bccd0ed1
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
[PMM: tweaked comment message a little]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
translate-all.c

index ba5c8403d30b83f915253dc9d08edd7bc2af5913..9d150fb2b20ecc6c9de7b36f1cf2f85eff743b28 100644 (file)
@@ -270,14 +270,14 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t retaddr)
 }
 
 #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;