summaryrefslogtreecommitdiffstats
path: root/Include/pyatomic.h
diff options
context:
space:
mode:
authorSegev Finer <segev208@gmail.com>2017-08-20 22:45:46 (GMT)
committerAntoine Pitrou <pitrou@free.fr>2017-08-20 22:45:46 (GMT)
commit0267128aa4dc7c383c341c19833c5d506eae9c93 (patch)
treecfd8e3a1d1542f4f93ac85e6e234131073191195 /Include/pyatomic.h
parent1d1d3e9db882d78433f5bc8dbe7df929f4b6b5e1 (diff)
downloadcpython-0267128aa4dc7c383c341c19833c5d506eae9c93.zip
cpython-0267128aa4dc7c383c341c19833c5d506eae9c93.tar.gz
cpython-0267128aa4dc7c383c341c19833c5d506eae9c93.tar.bz2
bpo-9566 & bpo-30747: Silence warnings from pyatomic.h macros (#3140)
* bpo-9566: Silence warnings from pyatomic.h macros Apparently MSVC is too stupid to understand that the alternate branch is not taken and emits a warning for it. Warnings added in https://github.com/python/cpython/pull/2383 * bpo-9566: A better fix for the pyatomic.h warning * bpo-9566: Remove a slash
Diffstat (limited to 'Include/pyatomic.h')
-rw-r--r--Include/pyatomic.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Include/pyatomic.h b/Include/pyatomic.h
index 832d951..4cbc529 100644
--- a/Include/pyatomic.h
+++ b/Include/pyatomic.h
@@ -352,14 +352,14 @@ inline int _Py_atomic_load_32bit(volatile int* value, int order) {
#define _Py_atomic_store_explicit(ATOMIC_VAL, NEW_VAL, ORDER) \
if (sizeof(*ATOMIC_VAL._value) == 8) { \
- _Py_atomic_store_64bit(ATOMIC_VAL._value, NEW_VAL, ORDER) } else { \
- _Py_atomic_store_32bit(ATOMIC_VAL._value, NEW_VAL, ORDER) }
+ _Py_atomic_store_64bit((volatile long long*)ATOMIC_VAL._value, NEW_VAL, ORDER) } else { \
+ _Py_atomic_store_32bit((volatile long*)ATOMIC_VAL._value, NEW_VAL, ORDER) }
#define _Py_atomic_load_explicit(ATOMIC_VAL, ORDER) \
( \
sizeof(*(ATOMIC_VAL._value)) == 8 ? \
- _Py_atomic_load_64bit(ATOMIC_VAL._value, ORDER) : \
- _Py_atomic_load_32bit(ATOMIC_VAL._value, ORDER) \
+ _Py_atomic_load_64bit((volatile long long*)ATOMIC_VAL._value, ORDER) : \
+ _Py_atomic_load_32bit((volatile long*)ATOMIC_VAL._value, ORDER) \
)
#elif defined(_M_ARM) || defined(_M_ARM64)
typedef enum _Py_memory_order {