i686-w64-mingw32-gcc 4.7.3: ignores __attribute__((packed)), regression?
Christian Franke
Christian.Franke@t-online.de
Wed Jul 10 22:37:00 GMT 2013
The new MinGW-w64 4.7.3 gcc apparently ignores __attribute__((packed)).
Cygwin's gcc 4.7.3 and older MinGW-w64 4.5.3 work as expected.
Testcase:
$ cat packed.c
struct packed { char a; short b; } __attribute__((packed));
int size = sizeof(struct packed);
$ i686-w64-mingw32-gcc --version
i686-w64-mingw32-gcc (GCC) 4.7.3
...
$ i686-w64-mingw32-gcc -S packed.c
$ cat packed.s
...
_size:
.long 4
$ gcc --version
gcc (GCC) 4.7.3
...
$ gcc -S packed.c
$ cat packed.s
...
_size:
.long 3
$ x86_64-w64-mingw32-gcc --version
x86_64-w64-mingw32-gcc (GCC) 4.5.3
...
$ x86_64-w64-mingw32-gcc -S packed.c
$ cat packed.s
...
size:
.long 3
If #pragma pack(1) is used instead, it works as expected also with
i686-w64-mingw32-gcc 4.7.3.
(Upstream?) bug ?
Christian
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list