[ovs-dev] [PATCH lib:] Avoid clobbered variable warning on ppc64le.

David Wilder dwilder at us.ibm.com
Tue Oct 8 17:04:17 UTC 2019

Since commit e2ed6fbeb1, Ci on ppc64le with Ubuntu 16.04.6 LTS throws
this error:

lib/fatal-signal.c: In function 'send_backtrace_to_monitor':
lib/fatal-signal.c:168:9: error: variable 'dep' might be clobbered by
'longjmp' or 'vfork' [-Werror=clobbered]
     int dep;

Declaring dep as a volatile int.

Signed-off-by: David Wilder <wilder at us.ibm.com>
 lib/fatal-signal.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/fatal-signal.c b/lib/fatal-signal.c
index 7733850d5..09f7c6ecf 100644
--- a/lib/fatal-signal.c
+++ b/lib/fatal-signal.c
@@ -165,7 +165,8 @@ fatal_signal_add_hook(void (*hook_cb)(void *aux), void (*cancel_cb)(void *aux),
 static inline void
 send_backtrace_to_monitor(void) {
-    int dep;
+    /* volatile added to prevent a "clobbered" error on ppc64le with gcc */
+    volatile int dep;
     struct unw_backtrace unw_bt[UNW_MAX_DEPTH];
     unw_cursor_t cursor;
     unw_context_t uc;

More information about the dev mailing list