Commit 26e2faf5 authored by Eli Bendersky's avatar Eli Bendersky

Add warning in ctypes documentation for #16575 and #16576

parent 9f7e247a
...@@ -602,6 +602,13 @@ for debugging because they can provide useful information:: ...@@ -602,6 +602,13 @@ for debugging because they can provide useful information::
.. _ctypes-structureunion-alignment-byte-order: .. _ctypes-structureunion-alignment-byte-order:
.. warning::
:mod:`ctypes` does not support passing unions or structures with bit-fields
to functions by value. While this may work on 32-bit x86, it's not
guaranteed by the library to work in the general case. Unions and
structures with bit-fields should always be passed to functions by pointer.
Structure/union alignment and byte order Structure/union alignment and byte order
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment