Bug 30945 - iostream includes excessive headers - results in large files
Summary: iostream includes excessive headers - results in large files
Status: RESOLVED DUPLICATE of bug 28080
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-24 05:56 UTC by Daniel
Modified: 2007-02-24 10:15 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel 2007-02-24 05:56:15 UTC
On Bjarne Stroustrup's site, it's says in the FAQs:

________________________________
Why is the code generated for the "Hello world" program ten times larger for C++ than for C?
It isn't on my machine, and it shouldn't be on yours. I have even seen the C++ version of the "hello world" program smaller than the C version. When I recently (2004) tested using gcc -o2 on a Unix, the two versions (iostreams and stdio) yielded identical sizes. There is no language reason why the one version should be larger than the other. It is all an issue on how the implementor organized the libraries. If one version is significantly larger than the other, report the problem to the implementor of the larger.
__________________________________

Perhaps unnecessary files are being included in <iostream>. These files should NOT be over 400 KB. In fact, a standard Win32 header compiles to a smaller file.
Comment 1 Andrew Pinski 2007-02-24 09:00:18 UTC
Really this is nothing to do with header files really.  
I think the FAQ is wrong with respect to the C++98 standard as he forgets there are locale supported added which brings in a lot.

Also including iostream, forces the initialization of the C++ standard streams.
Comment 2 Paolo Carlini 2007-02-24 10:15:09 UTC
Let's consider this simply a duplicate of 28080. I'm improving the situation a bit, but don't expect miracles ;)

*** This bug has been marked as a duplicate of 28080 ***