GCC 4.7.0 breaks __attribute__((packed)) behavior on... (Developers)
> > I understand this was done for some reasons of compatability with M$
> and/or
> > 64bit stuff but I don't agree with this way.
>
> But if they left it incompatible with MSVC, other people would complain.
> You can't please everybody, something had to change. (Though, again, this
> may indeed be a bug where "packed" should always be minimal, but I vaguely
> doubt it.)
But the problem is in time sequence. From the beginning the mingw used -mno-ms-bitfields as default and when somebody needed to be compatible with MS code he suppressed this by -mms-bitfields in makefile. And it worked for about 10 years. But most of GNU libs was compiled by default with -mno-ms-bitfields. Now they change it and it affect all existing sources, makefiles and precompiled libs. This is the most problem I see.
> "-Wpadded
I tried Wpadded and it's silent :\
> Two attributes are currently defined for i386 configurations: ms_struct and
> gcc_struct
Yeah, interesting. I tried
__attribute__ ((gcc_struct, __packed__))
together and this enforced real packing. Thanks. So in my code I can add gcc_struct everywhere needed but still need to modify makefiles of older libs. Since what gcc version was gcc_struct supported? Will older gccs safely ignore it?
EDIT:
gcc_struct
Found in versions: 3.4
So it exist quite a long time...
---
DOS gives me freedom to unlimited HW access.
Complete thread:
- GCC 4.7.0 breaks __attribute__((packed)) behavior on... - RayeR, 04.09.2012, 18:53 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- GCC 4.7.0 breaks __attribute__((packed)) behavior on... - Rugxulo, 04.09.2012, 23:16
- GCC 4.7.0 breaks __attribute__((packed)) behavior on... - RayeR, 05.09.2012, 03:46
- GCC 4.7.0 breaks __attribute__((packed)) behavior on... - Rugxulo, 05.09.2012, 11:26
- GCC 4.7.0 breaks __attribute__((packed)) behavior on... - RayeR, 05.09.2012, 19:09
- GCC 4.7.0 breaks __attribute__((packed)) behavior on... - Rugxulo, 05.09.2012, 11:26
- GCC 4.7.0 breaks __attribute__((packed)) behavior on... - RayeR, 05.09.2012, 03:46
- GCC 4.7.0 breaks __attribute__((packed)) behavior on... - Rugxulo, 04.09.2012, 23:16
Mix view