]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-97588: Align ctypes struct layout to GCC/MSVC (GH-97702)
authorMatthias Görgens <matthias.goergens@gmail.com>
Wed, 29 May 2024 10:02:53 +0000 (18:02 +0800)
committerGitHub <noreply@github.com>
Wed, 29 May 2024 10:02:53 +0000 (12:02 +0200)
commit18c1a8d3a81bf8d287a06f2985bbf65c9a9b9794
tree6d33a4e84521f7a912484cc9e1a51a05ab66528f
parentc1e9647107c854439a9864b6ec4f6784aeb94ed5
gh-97588: Align ctypes struct layout to GCC/MSVC (GH-97702)

Structure layout, and especially bitfields, sometimes resulted in clearly
wrong behaviour like overlapping fields. This fixes

Co-authored-by: Gregory P. Smith <gps@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
17 files changed:
Doc/library/ctypes.rst
Doc/whatsnew/3.13.rst
Include/internal/pycore_global_objects_fini_generated.h
Include/internal/pycore_global_strings.h
Include/internal/pycore_runtime_init_generated.h
Include/internal/pycore_unicodeobject_generated.h
Lib/test/test_ctypes/test_bitfields.py
Lib/test/test_ctypes/test_generated_structs.py [new file with mode: 0644]
Makefile.pre.in
Misc/NEWS.d/next/C API/2022-10-01-09-56-27.gh-issue-97588.Gvg54o.rst [new file with mode: 0644]
Modules/_ctypes/_ctypes_test.c
Modules/_ctypes/_ctypes_test_generated.c.h [new file with mode: 0644]
Modules/_ctypes/cfield.c
Modules/_ctypes/ctypes.h
Modules/_ctypes/stgdict.c
PCbuild/_ctypes_test.vcxproj
PCbuild/_ctypes_test.vcxproj.filters