diff mbox

libbacktrace patch committed: Fix load_pointer if no atomic or sync functions

Message ID CAOyqgcXD3wy7MdT_kPM8xgUWifLWQxaaRPth2i5u3JkS0xTrhQ@mail.gmail.com
State New
Headers show

Commit Message

Ian Lance Taylor Oct. 23, 2014, 10:40 p.m. UTC
This patch to libbacktrace fixes the type returned by the backup
definition of backtrace_atomic_load_pointer for the case where
libbacktrace is compiled with neither the atomic nor the sync
functions available.  This case does not arise in general but could
arise from other uses of the library, or when building stage 1 with a
very old host compiler.  Bootstrapped and ran libbacktrace tests on
x86_64-unknown-linux-gnu, which proves nothing, really.

Ian


2014-10-23  Ian Lance Taylor  <iant@google.com>

* internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
Fix to return void *.
diff mbox

Patch

Index: internal.h
===================================================================
--- internal.h	(revision 216522)
+++ internal.h	(working copy)
@@ -99,7 +99,7 @@  extern void backtrace_atomic_store_int (
 /* We have neither the sync nor the atomic functions.  These will
    never be called.  */
 
-#define backtrace_atomic_load_pointer(p) (abort(), 0)
+#define backtrace_atomic_load_pointer(p) (abort(), (void *) NULL)
 #define backtrace_atomic_load_int(p) (abort(), 0)
 #define backtrace_atomic_store_pointer(p, v) abort()
 #define backtrace_atomic_store_size_t(p, v) abort()