This is the mail archive of the
cygwin
mailing list for the Cygwin project.
i686-w64-mingw32-gcc 4.7.3: ignores __attribute__((packed)), regression?
- From: Christian Franke <Christian dot Franke at t-online dot de>
- To: cygwin at cygwin dot com
- Date: Thu, 11 Jul 2013 00:12:59 +0200
- Subject: i686-w64-mingw32-gcc 4.7.3: ignores __attribute__((packed)), regression?
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