[MPlayer-dev-eng] mingw64 4.7.x struct alignment behavior has changed

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Jan 18 21:35:25 CET 2014


On Fri, Jan 10, 2014 at 02:53:10AM +0100, Gianluigi Tiesi wrote:
> Sorry for cross posting but it's related both to mplayer/ffmpeg
> 
> as stated in this announce:
> http://cygwin.com/ml/cygwin-announce/2013-07/msg00011.html
> 
> For gcc-4.7.x, struct alignment behavior has changed, -mms-bitfields is
> now default for better MSVC compatibility. This may cause ABI changes
> in libraries that expose data structures directly to clients. Workaround
> include marking the struct with the gcc_struct attributes.
> 
> this actually breaks mplayer libmpdemux/asf.h structs
> 
> e.g. ASF_stream_header_t is 56 bytes instead of 54

This doesn't make sense, according to the documentation -mms-bitfields
only affects bitfields.
These structs do not use bitfields.
The default 8-byte structure alignment could cause this, except
that these are all marked with packed attribute which
a) Is gcc-specific, so applying MS-compatibility stuff would be so
idiotic I'd call it a bug
b) Even on MS compilers packed structures should not have padding at the
end

So I think this must be an actual compiler bug.


More information about the MPlayer-dev-eng mailing list