From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17323 invoked by alias); 25 Apr 2002 20:56:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 17305 invoked by uid 71); 25 Apr 2002 20:56:01 -0000 Date: Thu, 25 Apr 2002 13:56:00 -0000 Message-ID: <20020425205601.17304.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Phil Edwards Subject: Re: c++/6257: C-library symbols enter global namespace Reply-To: Phil Edwards X-SW-Source: 2002-04/txt/msg01371.txt.bz2 List-Id: The following reply was made to PR c++/6257; it has been noted by GNATS. From: Phil Edwards To: marc-oliver.gewaltig@hre-ftr.f.rd.honda.co.jp Cc: gcc-gnats@gcc.gnu.org Subject: Re: c++/6257: C-library symbols enter global namespace Date: Thu, 25 Apr 2002 16:46:39 -0400 On Thu, Apr 11, 2002 at 04:16:58PM -0000, marc-oliver.gewaltig@hre-ftr.f.rd.honda.co.jp wrote: > >Category: c++ This should be libstdc++, but GNATs won't let me fix that. Hmmm. > >Release: unknown-1.0 This makes a difference. Lots of stuff changed between 2.x and 3.x. > >Description: > The C++ standard states that > - all C++ header files define their symbols in namespace std > - all C header files, used in the form define their symbol in > namespace std (Annex D 5.2,3). > > However, g++ puts C symbols in the global namespace, > even if included via headers. We know. Interoperating with an arbitrary C library (which is what we are required to do) is quite difficult. As yet very few people have volunteered to work on a solution, and those that have volunteered have very little time. Some of the partial solutions are in the source tree and can be turned on with the appropriate --enable options. To use your two examples, making this work on Linux should be much easier than on Solaris. > >Fix: > Put all C symbols in the namespace std, if included > by headers. You realize, of course, that this is completely useless? "Fix the problem" is an implied answer. If you'd like to help us work on an actual patch, we'd be very grateful.