Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c2d90fb

Browse files
committed
Add warning in ctypes documentation for #16575 and #16576
2 parents 98281ce + 490cf44 commit c2d90fb

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Doc/library/ctypes.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,13 @@ for debugging because they can provide useful information::
608608

609609
.. _ctypes-structureunion-alignment-byte-order:
610610

611+
.. warning::
612+
613+
:mod:`ctypes` does not support passing unions or structures with bit-fields
614+
to functions by value. While this may work on 32-bit x86, it's not
615+
guaranteed by the library to work in the general case. Unions and
616+
structures with bit-fields should always be passed to functions by pointer.
617+
611618
Structure/union alignment and byte order
612619
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
613620

0 commit comments

Comments
 (0)