From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7936 invoked by alias); 2 May 2006 17:08:49 -0000 Received: (qmail 7919 invoked by uid 48); 2 May 2006 17:08:45 -0000 Date: Tue, 02 May 2006 17:08:00 -0000 From: "marc dot glisse at normalesup dot org" To: glibc-bugs@sources.redhat.com Message-ID: <20060502170845.2633.marc.glisse@normalesup.org> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/2633] New: _GLIBCPP_USE_NAMESPACES issues X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00023.txt.bz2 List-Id: Hello, I tried to define the _GLIBCPP_USE_NAMESPACES macro for c++ and hit several problems. Here are some of them (I should have taken notes...). In stdio.h, there is "typedef struct _IO_FILE FILE;" in namespace std, but struct _IO_FILE has not been declared yet so the compiler assumes it is in namespace std and later refuses to convert stdout to a std::FILE*. It would be sufficient to declare _IO_FILE (in the global namespace) before this typedef. pthread.h declares __jmp_buf_tag in the global namespace but setjmp.h declares it in namespace std. This means the declarations for __sigsetjmp that follow don't match. locale.h: I believe __BEGIN_NAMESPACE_STD could be moved before the definition of struct lconv. In wchar.h, I can read there is a workaround for gcc stddef.h that puts wint_t in the global namespace, but if I modify stddef.h to put wint_t in namespace std and define _WINT_T, the functions declared in namespace __c99 or in the global namespace have trouble with wint_t not being visible. wchar.h: the declaration of struct tm looks like this: __BEGIN_NAMESPACE_STD struct tm; __USING_NAMESPACE_STD(tm) __END_NAMESPACE_STD My guess is that the last 2 lines are in the wrong order. Functions like wcscpy, wcscat or wcscmp should be in namespace std, not __c99. I almost started my tests by replacing __c99 by std in sys/cdefs.h to remove some errors. I was surprised to see __c99 was not made a subnamespace of std (and there is no using namespace std in __c99), but I guess there are reasons. -- Summary: _GLIBCPP_USE_NAMESPACES issues Product: glibc Version: 2.4 Status: NEW Severity: minor Priority: P3 Component: libc AssignedTo: drepper at redhat dot com ReportedBy: marc dot glisse at normalesup dot org CC: glibc-bugs at sources dot redhat dot com http://sourceware.org/bugzilla/show_bug.cgi?id=2633 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.