[issue17884] Try to reuse stdint.h types like int32_t

STINNER Victor report at bugs.python.org
Wed May 1 00:52:46 CEST 2013


New submission from STINNER Victor:

In different places, macros like SIZEOF_VOID_P or SIZEOF_LONG to choose a type, whereas the C language proposes standard types since ISO C99: intXX_t and uintXX_t (8, 16, 32, 64), intptr_t, etc.

Python should rely on these new types instead of trying to reimplement this standard. autotools provides missing types if needed. On Windows, stdint.h is supported in Microsoft Visual Studio 2010.

Attached patch reuses stdint.h types in different places. I only tested it on Linux Fedora 11.

sha3 module should also be modified.

I don't know if int64_t and uint64_t are always supported, nor if we can rely on them. Does Python support platform without 64-bit integer type?

The md5 module uses PY_LONG_LONG to get a 64-bit type. Does anyone know a platform where the md5 module is not compiled?

----------
files: reuse_stdint_types.patch
keywords: patch
messages: 188192
nosy: Devin Jeanpierre, haypo, mark.dickinson
priority: normal
severity: normal
status: open
title: Try to reuse stdint.h types like int32_t
versions: Python 3.4
Added file: http://bugs.python.org/file30083/reuse_stdint_types.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17884>
_______________________________________


More information about the Python-bugs-list mailing list