[Python-Dev] void* <-> size_t (original) (raw)
Serhiy Storchaka storchaka at gmail.com
Sun May 13 16:28:15 CEST 2012
- Previous message: [Python-Dev] [Python-checkins] cpython: Issue #14779: Do not use get_config_var('SIZEOF_VOID_P') on OS X 64-/32-bit
- Next message: [Python-Dev] WSGI paranoia with stdout/stderr
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 13.05.12 12:48, Stefan Krah wrote:
The C standard doesn't guarantee sizeof(void *) == sizeof(sizet). In fact, there are machines where sizeof(void *)> sizeof(sizet):
http://comments.gmane.org/gmane.comp.programming.garbage-collection.boehmgc/651 http://www-01.ibm.com/support/docview.wss?uid=swg27019425
I noticed recently that the code is often used unsafe casting void* -> size_t and size_t -> void*. For example:
const char *aligned_end = (const char *) ((size_t) end &
~LONG_PTR_MASK);
I defer this issue until issues 14624 and 14624 will be resolved (same method is used in the suggested patches), but once it already mentioned, should be replaced size_t to Py_uintptr_t in all such castings?
- Previous message: [Python-Dev] [Python-checkins] cpython: Issue #14779: Do not use get_config_var('SIZEOF_VOID_P') on OS X 64-/32-bit
- Next message: [Python-Dev] WSGI paranoia with stdout/stderr
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]