Bug 479409 - multi_pass.hpp includes iostream.h but doesn't need it
Summary: multi_pass.hpp includes iostream.h but doesn't need it
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: boost
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Benjamin Kosnik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-01-09 12:47 UTC by Caolan McNamara
Modified: 2013-08-09 05:48 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-12 11:26:16 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
patch to remove unused iostreams include (585 bytes, patch)
2009-01-09 12:47 UTC, Caolan McNamara
no flags Details | Diff

Description Caolan McNamara 2009-01-09 12:47:02 UTC
Created attachment 328539 [details]
patch to remove unused iostreams include

Description of problem:
boost_1_37_0/boost/spirit/home/classic/iterator/multi_pass.hpp includes iostream.h but doesn't seem to require it

Version-Release number of selected component (if applicable):
boost-1.37.0-2.fc11

The problem is that anything that includes that header will then end up including iostream.h which has a global object in it to force the iostream/stdio locking methods in the .o file, i.e. 

std::ios_base::Init::Init()
and
std::ios_base::Init::~Init()

and calling them in the global .so ctors and dtors which is unnecessary if iostreams aren't actually used is a titchy startup-time de-optimization

to reproduce

before:
> echo "#include <boost/spirit/home/classic/iterator/multi_pass.hpp>" | g++ -c -x c++ - -o test.o
> nm test.o 
000000000000003d t _GLOBAL__I_
0000000000000000 t _Z41__static_initialization_and_destruction_0ii
                 U _ZNSt8ios_base4InitC1Ev
                 U _ZNSt8ios_base4InitD1Ev
0000000000000000 b _ZStL8__ioinit
                 U __cxa_atexit
                 U __dso_handle
                 U __gxx_personality_v0

after:
> echo "#include <boost/spirit/home/classic/iterator/multi_pass.hpp>" | g++ -c -x c++ - -o test.o
> nm test.o 
<nothing>

Comment 1 Petr Machata 2009-01-12 11:26:16 UTC
Built in rawhide.  Thanks for the patch!


Note You need to log in before you can comment on or make changes to this bug.