namespace issues with old C headers

Gabriel Dos Reis gdr@integrable-solutions.net
Tue Apr 15 19:05:00 GMT 2003


Joe Buck <jbuck@synopsys.com> writes:

| On Tue, Apr 15, 2003 at 09:57:52AM +0200, Gabriel Dos Reis wrote:
| > Joe Buck <jbuck@synopsys.com> writes:
| > 
| > | On Sat, Apr 12, 2003 at 08:47:21PM +0200, Gabriel Dos Reis wrote:
| > | > The standard isn't silent: It explicitly says that a standard header
| > | > can include another standard header.
| > | 
| > | And this leads to accidental portability problems. 
| > 
| > Yes, and the following is *known* not to be portable: 
| > 
| >   #include <iostream>
| >   
| >    int main()
| >    {
| >       std::cout << "Hello World\n";
| >    }
| > 
| > No need of assert() to demonstrate the problem.
| 
| Sigh.  If you wish to pedantically dismiss something that has been a
| huge productivity problem, fine.

I believe you missed the point.

It has been stated that libstdc++-v3 is doing "promiscuous includes".
I'm trying to have us debate on technical issues, not on heavily loaded
rhetorical arguments.  The point I'm trying to make is that where to
draw the lines is not obvious and I would like to have us draw the
lines on well understood arguments (preferably technical) ones, but not
because someone used heavily loaded rhetorical arguments.

Please, do reconsider the above example.

|  (any real program is going to
| use its arguments, so dinging me for not including them in a quickly
| typed example is just bogus).

I think you really missed my point.  If you have a close look at 
"The C++ Programming Language", by Bjarne Stroustrup, 3rd edition,
you'll notice that it is the first C++ program -- and it has been
historically so.  Do you think we should try hard to make it fail?  If
so, why?


Note also that this has drifted from the original debate which is
<math.h> vs. <cmath>.

| Failure to include <assert.h> when using assert() has broken dozens
| of nightly builds in our group.  It would be nice to have some
| solution for issues like this.
| 
| I respect your expertise, but some of us need to get work done.

Don't get me wrong, I too need to have my job done.  Please, do
reconsider the above program.  It is *not* an academic exercise.

-- Gaby



More information about the Libstdc++ mailing list