From: Eli Bendersky Date: Sat, 9 Mar 2013 13:56:35 +0000 (-0800) Subject: Add warning in ctypes documentation for #16575 and #16576 X-Git-Tag: v2.7.4rc1~55 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=26e2faf57da5e1c26f7ea25e5a1cb066ad7020cb;p=thirdparty%2FPython%2Fcpython.git Add warning in ctypes documentation for #16575 and #16576 --- diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 7f62e30561eb..c72a0b5a4eda 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -602,6 +602,13 @@ for debugging because they can provide useful information:: .. _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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^