This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/48547] iostream and some other C++ libraries do not work with -fpack-struct


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48547

--- Comment #18 from Jim Michaels <jmichae3 at yahoo dot com> 2011-04-11 07:48:08 UTC ---
I will admit I have not tried this with any VC++ compiler newer than VC++ 6.0,
which is circa windows NT/98 era.  things have changed a lot since then.
I know this works in Borland C++ 5.5.1 free edition and VC++ 6.0 (very old). 
But the STL was upgraded since then and TR1 came out.  So things maybe don't
work like they used to on any compiler?  maybe no more static linking on any
compiler?

You are right, I was just reading about why you can't (and shouldn't)
statically link libstdc++ in a blog... It was kind of disappointing.  I really
wanted to make monolithic executables for the main reason that you can't put
32-bit and 64-bit libstdc++ DLL's and gcc runtime DLL's (shared libraries) and
executables in the same directory!

and the installer I use (NSIS) won't run your programs properly (because the
shortcuts are lame) if your executables and all your files aren't all in the
same directory.  and you can't just add them to the path either because that's
broken.

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++.

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!).

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]