Stipping away locale support

Pétur Runólfsson peturr02@ru.is
Mon Aug 18 10:39:00 GMT 2003


> I am considering (given your last example) if it is the userfriendly
> version of std::terminate that is dragging in all of this for you as
> it is printing demangled names and what not.

This still doesn't explain why locale and iostreams get included in
the executable. After all, the demangler only includes <string> and
<vector>. Here are some theories:

1) Something in the library has #include <iostream>. Even when using
shared libraries this is bad because it has runtime overhead. I can
only find two places, 
  include/ext/ropeimpl.h
  include/stdc++.h
I'm testing a patch for ropeimpl.h, but it also seems wrong for
stdc++.h to include <iostream> and <cassert>.

2) string uses __throw_length_error, which brings in functexcept.cc,
which uses ios_base::failure::failure(), which is defined in ios.cc,
which brings in the rest of locale and iostreams. This can be fixed
by moving __throw_ios_failure or ios_base::failure to separate
source files.

Regards,
Petur



More information about the Libstdc++ mailing list