This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Arfrever, John.Malmberg, Vitor.de.Lima, fijall, gustavotemple, koobs, lbianc, neologix, vstinner
Date 2016-01-20.10:57:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1453287433.06.0.917991277181.issue26161@psf.upfronthosting.co.za>
In-reply-to
Content
Attached patch fixes compiler warnings on atomic pointers.

Python has 4 implementations of atomic types:

* <stdatomic.h>
* GCC 4.7+ builtin atomic operations
* GCC x86 and x86_64 assembler
* volatile

The type of atomic pointers changes depending on the implementation. Attached patch changes the _Py_atomic_address to use atomic_uintptr_t (<stdatomic.h>) or Py_uintptr_t type internally.

The patchs also adds GET_TSTATE(), SET_TSTATE() and GET_INTERP_STATE() macros in pystate.c to make the code more readable.

This issue is a follow up of the issue #22038 which added support for <stdatomic.h> in Python/pyatomic.h. See also issues #23644 (compilation issue with g++), #25150 (compilation issue with OpenMP) and #26154 (add _PyThreadState_UncheckedGet()).

I would be "nice" to backport this change to Python 3.5.2 to fix the compiler warning, but I'm not 100% confident that my patch works on all compilers and all platforms. Maybe it's better to "experiment" it only in Python 3.6.

Note: I copied the nosy list of the issue #22038 since this one is a follow up.
History
Date User Action Args
2016-01-20 10:57:13vstinnersetrecipients: + vstinner, Arfrever, neologix, fijall, koobs, John.Malmberg, Vitor.de.Lima, gustavotemple, lbianc
2016-01-20 10:57:13vstinnersetmessageid: <1453287433.06.0.917991277181.issue26161@psf.upfronthosting.co.za>
2016-01-20 10:57:12vstinnerlinkissue26161 messages
2016-01-20 10:57:12vstinnercreate