Avoid libbacktrace warnings with old compilers

Message ID CAOyqgcWLHygX5DRgoyt8KJzb4VWCJpt42CzAs8y3Piphnh2jjw@mail.gmail.com
State New
Headers show
Series
  • Avoid libbacktrace warnings with old compilers
Related show

Commit Message

Ian Lance Taylor Sept. 26, 2019, 10:20 p.m.
This patch to libbacktrace avoids a compilation warning when building
libbacktrace with an old compiler.  This fixes PR 91908.  Bootstrapped
and ran libbacktrace tests.  Committed to mainline.

Ian

2019-09-26  Ian Lance Taylor  <iant@golang.org>

PR libbacktrace/91908
* pecoff.c (backtrace_initialize): Explicitly cast unchecked
__sync_bool_compare_and_swap to void.
* xcoff.c (backtrace_initialize): Likewise.

Patch

Index: pecoff.c
===================================================================
--- pecoff.c	(revision 275698)
+++ pecoff.c	(working copy)
@@ -922,7 +922,8 @@  backtrace_initialize (struct backtrace_s
       if (found_sym)
 	backtrace_atomic_store_pointer (&state->syminfo_fn, coff_syminfo);
       else
-	__sync_bool_compare_and_swap (&state->syminfo_fn, NULL, coff_nosyms);
+	(void) __sync_bool_compare_and_swap (&state->syminfo_fn, NULL,
+					     coff_nosyms);
     }
 
   if (!state->threaded)
Index: xcoff.c
===================================================================
--- xcoff.c	(revision 275698)
+++ xcoff.c	(working copy)
@@ -1592,7 +1592,8 @@  backtrace_initialize (struct backtrace_s
       if (found_sym)
 	backtrace_atomic_store_pointer (&state->syminfo_fn, xcoff_syminfo);
       else
-	__sync_bool_compare_and_swap (&state->syminfo_fn, NULL, xcoff_nosyms);
+	(void) __sync_bool_compare_and_swap (&state->syminfo_fn, NULL,
+					     xcoff_nosyms);
     }
 
   if (!state->threaded)