Skip to contentSkip to conversation

translate-all: Marked map_exec() with the 'unused' attribute

PATCH In review SeokYeon Hwang 3 participants 3 messages Nov 3, 2014 – Nov 5, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 translate-all: Marked map_exec() with the 'unused' attribute

Marked map_exec() with the 'unused' attribute to avoid '-Wunused-function' on clang 3.4 or later.

---
 translate-all.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
translate-all.c +2 -2
index ba5c840..9d150fb 100644
@@ -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;
 
Signature · 1 line
2.1.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 29 lines · SeokYeon Hwang

Marked map_exec() with the 'unused' attribute to avoid '-Wunused-function' on clang 3.4 or later.

---
 translate-all.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
translate-all.c +2 -3
index ba5c840..9d150fb 100644
@@ -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;
 
--
Quoted 1 line

2.1.0

thanks
-- PMM

Reviewed-by on v2 1/1
#2 lore raw
In reply to SeokYeon Hwang
Quoted 3 lines · SeokYeon Hwang

Marked map_exec() with the 'unused' attribute to avoid '-Wunused-function' on clang 3.4 or later.

Quoted 26 lines
---
 translate-all.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
translate-all.c +2 -2
index ba5c840..9d150fb 100644
@@ -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;