diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -603,6 +603,13 @@ .. _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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^