Bug 479409

Summary: multi_pass.hpp includes iostream.h but doesn't need it
Product: [Fedora] Fedora Reporter: Caolan McNamara <caolanm>
Component: boostAssignee: Benjamin Kosnik <bkoz>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: bkoz, mnewsome, pmachata
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-12 11:26:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch to remove unused iostreams include none

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!