http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48547
--- Comment #19 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-04-11 07:56:16 UTC --- (In reply to comment #18) > > it sounds to me from your post that it would be a lot of extra work for the > compiler builders, making 2 sets of binaries for the cases of -fpack-struct > and > not -fpack-struct. If this could be accomplished and even have statically > linked libstdc++ (at least the latter) I think a lot of people would be very > happy, and for the former, a lot of compiler users would be a lot less > disgruntled with g++. I think you overestimate the number of people who care about this issue. > so... why is -fpack-struct even there? is it for gcc only and not for g++? > because it works fine for ANSI C. just not any lib with dependent upon > iostream (like iterator - gaah!). It works ok for some C++ code, but not if you include the standard library headers. > by the way, in the header files of the C++ files where I see the structures > defined for win32, I *don't* remember ever seeing see #pragma pack(). > but yes, it is in VC++. > I just put a link to #pragma pack() on my web site for new compiler users. > I've been writing programs in C for about 20 years and I have not learned > about > this until now. never heard about it. nobody talks about it. It's documented in the manual: http://gcc.gnu.org/onlinedocs/gcc/Structure_002dPacking-Pragmas.html