From 7d5861d0f07e7b3ba8b954db863e660fceed6a5f Mon Sep 17 00:00:00 2001 From: Jeff Hammond Date: Sun, 16 Jun 2013 20:50:00 +0000 Subject: [PATCH] Fix declaration that XLC rejected Changed volatile void* volatile* declarator to volatile void* volatile. Fixes #1284 Change-Id: I133f480b060ab4723988bd3059e5bd20ebc9df7a --- include/thread_mpi/atomic/xlc_ppc.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/thread_mpi/atomic/xlc_ppc.h b/include/thread_mpi/atomic/xlc_ppc.h index 0dd1f6753a..3b4f985db3 100644 --- a/include/thread_mpi/atomic/xlc_ppc.h +++ b/include/thread_mpi/atomic/xlc_ppc.h @@ -83,7 +83,10 @@ tMPI_Atomic_t; typedef struct tMPI_Atomic_ptr { - volatile char* volatile* value __attribute__ ((aligned(64))); /*!< Volatile, to avoid compiler aliasing */ + /* volatile char* volatile is not a bug, but means a volatile pointer + to a volatile value. This is needed for older versions of + xlc. */ + volatile char* volatile value __attribute__ ((aligned(64))); /*!< Volatile, to avoid compiler aliasing */ } tMPI_Atomic_ptr_t; @@ -139,8 +142,8 @@ static inline int tMPI_Atomic_ptr_cas(tMPI_Atomic_ptr_t *a, void* oldval, void* newval) { int ret; - volatile char* volatile* oldv = oldval; - volatile char* volatile* newv = newval; + volatile char* volatile oldv = (char*)oldval; + volatile char* volatile newv = (char*)newval; __fence(); /* this one needs to be here to avoid ptr. aliasing issues */ __eieio(); -- 2.11.4.GIT