Skip to contentSkip to conversation

rcu: Fix compiler warning for Windows builds

PATCH New Stefan Weil via qemu development 1 participant 1 message Dec 1

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rcu: Fix compiler warning for Windows builds

Compiler warning:

util/rcu.c:444:12: error:
variable 'atfork_depth' set but not used [-Werror,-Wunused-but-set-global]

The variable is currently not used for Windows builds.

---
 util/rcu.c | 6 ++++++
 1 file changed, 6 insertions(+)
util/rcu.c +6 -0
index acac9446ea9..7979707bf85 100644
@@ -441,16 +441,22 @@ static void rcu_init_complete(void)
     rcu_register_thread();
 }
 
+#ifdef CONFIG_POSIX
 static int atfork_depth = 1;
+#endif
 
 void rcu_enable_atfork(void)
 {
+#ifdef CONFIG_POSIX
     atfork_depth++;
+#endif
 }
 
 void rcu_disable_atfork(void)
 {
+#ifdef CONFIG_POSIX
     atfork_depth--;
+#endif
 }
 
 #ifdef CONFIG_POSIX
Signature · 1 line
2.47.3