namespace issues with old C headers

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


Joe Buck <jbuck@synopsys.com> writes:

| On Tue, Apr 15, 2003 at 09:11:30AM -0700, Joe Buck wrote:
| > 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.  (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 apologize for the parenthetical remark: your example is not taken from
| what I wrote.  Still, the dropping-the-arguments portability bug only
| affects short programs.

I've seen larger programs fail because they made unsopken arguments.

This is a thorny issue and I would really appreciate people think about it
before saying I'm playing a pedantic game.  It is -not- a pedantic game.
C++ is much trickier than C.

-- Gaby



More information about the Libstdc++ mailing list