This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: malloc_allocator.h
- From: Paolo Carlini <pcarlini at suse dot de>
- To: Matt Austern <austern at apple dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 09 Dec 2004 20:07:45 +0100
- Subject: Re: malloc_allocator.h
- References: <E32F52D4-4A13-11D9-9CA1-000A95BCF344@apple.com>
Matt Austern wrote:
Possibly stupid question... malloc_allocator is defined in namespace
__gnu_cxx, but it makes use of the names size_t, ptrdiff_t, malloc,
and free, without qualification. How can this be right? Shouldn't
they be std-qualified?
Well, this happens not only for malloc_allocator, but for *all* our
allocators. And, as long as <cstdlib> is included (Rth fixed this
recently exactly for malloc_allocator, are you alluding to that,
specific, problem?) everything ""works"" because, unfortunately, our C
headers still inject the names in the global namespace too.
We could easily qualify those names but the real problem with the C
headers will not be fixed very soon, AFAIK, seems very difficult to get
it right without controlling the libc, others know the technical details
of this much better than me.
Paolo.