changeset 27449:3cd724b25b3e

cast arguments in calls to atomic_fetch_add and atomic_fetch_sub * oct-atomic.c: Cast arguments in calls to atomic_fetch_add and atomic_fetch_sub.
author John W. Eaton <jwe@octave.org>
date Fri, 27 Sep 2019 16:06:25 -0400
parents b47705865de7
children c3ea5c772a84
files liboctave/util/oct-atomic.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/util/oct-atomic.c	Fri Sep 27 15:59:53 2019 -0400
+++ b/liboctave/util/oct-atomic.c	Fri Sep 27 16:06:25 2019 -0400
@@ -34,7 +34,8 @@
 octave_idx_type
 octave_atomic_increment (octave_idx_type *x)
 {
-  atomic_fetch_add (x, 1);
+  // This cast appears to be needed for some versions of clang.
+  atomic_fetch_add ((_Atomic octave_idx_type *) x, 1);
 
   return *x;
 }
@@ -42,7 +43,8 @@
 octave_idx_type
 octave_atomic_decrement (octave_idx_type *x)
 {
-  atomic_fetch_sub (x, 1);
+  // This cast appears to be needed for some versions of clang.
+  atomic_fetch_sub ((_Atomic octave_idx_type *) x, 1);
 
   return *x;
 }