Message ID | 20191008194019.31571-1-dwilder@us.ibm.com |
---|---|
State | Accepted |
Commit | 4093b4c79f1d522160258bb95acb171de58eabf9 |
Headers | show |
Series | [ovs-dev,lib:,v2] Avoid clobbered variable warning on ppc64le. | expand |
On Tue, Oct 08, 2019 at 12:40:19PM -0700, David Wilder wrote: > 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 <dwilder@us.ibm.com> Thanks, applied to master.
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;
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 <dwilder@us.ibm.com> --- v1->v2 Updated signed off by email address. lib/fatal-signal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)