diff -r b0ef6a5a6dcc Doc/library/ctypes.rst --- a/Doc/library/ctypes.rst Fri Sep 30 08:46:25 2011 +0300 +++ b/Doc/library/ctypes.rst Fri Sep 30 10:12:39 2011 -0700 @@ -633,6 +633,17 @@ >>> +It is important to note that bit field allocation and layout in memory is not +defined as a standard, rather its implementation is compiler-specific. On Windows, +Python uses the same bit field allocation as Microsoft VC++ compiler. On Unix +systems, it uses the same bit field allocation as GCC. This enables +interoperability with libraries compiled with VC++ on Windows and GCC on Unix. + +It is possible that the exact same Structure declaration containing a bit field +will have different sizes in memory on Unix and Windows systems, so it is +recommended that no assumptions are made about the structure size and layout. +For example, accessing the raw memory allocated for the Structure to retrieve +data will yield different results on different operating systems. .. _ctypes-arrays: