public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
From: "marc dot glisse at normalesup dot org" <sourceware-bugzilla@sourceware.org> To: glibc-bugs@sources.redhat.com Subject: [Bug libc/2633] New: _GLIBCPP_USE_NAMESPACES issues Date: Tue, 02 May 2006 17:08:00 -0000 [thread overview] Message-ID: <20060502170845.2633.marc.glisse@normalesup.org> (raw) 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.
next reply other threads:[~2006-05-02 17:08 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2006-05-02 17:08 marc dot glisse at normalesup dot org [this message] 2007-02-17 18:44 ` [Bug libc/2633] " drepper at redhat dot com 2007-02-19 17:09 ` marc dot glisse at normalesup dot org 2007-10-07 20:30 ` drepper at redhat dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20060502170845.2633.marc.glisse@normalesup.org \ --to=sourceware-bugzilla@sourceware.org \ --cc=glibc-bugs@sources.redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).