This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: malloc_allocator.h


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]