[Bug libstdc++/51749] Including <algorithm> pollutes global namespace

joseph at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Sun Jan 26 17:24:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51749

--- Comment #29 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
As was discussed a couple of years ago, the glibc maintainers are willing 
to work with the libstdc++ maintainers on providing whatever features 
libstdc++ headers need in a namespace-clean way (not exposing symbols not 
reserved by the relevant version of standard C++, when standard libstdc++ 
headers are used in a strict mode such as -std=c++98 or -std=c++11 and 
libstdc++ is built for recent-enough glibc).  But the libstdc++ people 
will need to work out exactly what interfaces are needed so we can work 
out how to expose them cleanly.

https://sourceware.org/ml/libc-alpha/2012-03/msg00311.html

(In the case of <func>64, providing __<func>64 is a good idea for other 
reasons where not already provided: it would allow fixing 
<https://sourceware.org/bugzilla/show_bug.cgi?id=14106>, 
_FILE_OFFSET_BITS=64 not being namespace-clean.  So I consider such a 
change appropriate for, at least, any function in a POSIX or C standard 
with a <func>64 version used for _FILE_OFFSET_BITS=64.)

I advise taking discussion of the details to libc-alpha, once you have 
more idea of exactly what features you would like glibc headers to expose 
in a C++-namespace-clean way.



More information about the Gcc-bugs mailing list