public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/51749] New: Including <algorithm> pollute global namespace
@ 2012-01-04  9:52 nospam.kotarou.dono at gmail dot com
  2012-01-04 10:17 ` [Bug libstdc++/51749] " rguenth at gcc dot gnu.org
                   ` (30 more replies)
  0 siblings, 31 replies; 32+ messages in thread
From: nospam.kotarou.dono at gmail dot com @ 2012-01-04  9:52 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51749
           Summary: Including <algorithm> pollute global namespace
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: nospam.kotarou.dono@gmail.com


Created attachment 26235
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26235
Preprocessed file

Including the header file <algorithm> on Linux seems to pollute the global
namespace. I discovered this while attempting to put <sys/select.h> in a
namespace. A quick example is given below:

test.cpp:

#include <algorithm>
fd_set set; // Should not compile
int main() { return 0; }

Compiles with: g++ test.cpp -o test

gcc -v:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/kotarou3/usr/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../mingw/gcc-src/configure
--prefix=/home/kotarou3/work/gcc-build/../gcc
--with-gmp=/home/kotarou3/work/gcc-build/../mingw/gmp
--with-mpfr=/home/kotarou3/work/gcc-build/../mingw/mpfr
--with-mpc=/home/kotarou3/work/gcc-build/../mingw/mpc --enable-languages=c,c++
--disable-win32-registry --enable-checking=release --enable-shared
Thread model: posix
gcc version 4.7.0 20111231 (experimental) (GCC)


^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2021-04-19 10:40 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-04  9:52 [Bug libstdc++/51749] New: Including <algorithm> pollute global namespace nospam.kotarou.dono at gmail dot com
2012-01-04 10:17 ` [Bug libstdc++/51749] " rguenth at gcc dot gnu.org
2012-01-04 10:26 ` paolo.carlini at oracle dot com
2012-01-07  4:14 ` nospam.kotarou.dono at gmail dot com
2012-01-07  8:10 ` jakub at gcc dot gnu.org
2012-01-08 12:15 ` nospam.kotarou.dono at gmail dot com
2012-01-08 12:41 ` redi at gcc dot gnu.org
2012-01-17  8:47 ` [Bug libobjc/51749] " nospam.kotarou.dono at gmail dot com
2012-01-17 11:06 ` [Bug libstdc++/51749] " paolo.carlini at oracle dot com
2012-01-17 12:01 ` [Bug libstdc++/51749] Including <algorithm> pollutes " redi at gcc dot gnu.org
2012-01-17 12:16 ` [Bug libobjc/51749] " nospam.kotarou.dono at gmail dot com
2012-01-17 12:54 ` [Bug libstdc++/51749] " redi at gcc dot gnu.org
2012-01-17 12:56 ` nospam.kotarou.dono at gmail dot com
2012-01-17 13:05 ` redi at gcc dot gnu.org
2012-01-29 10:39 ` nospam.kotarou.dono at gmail dot com
2012-01-29 11:33 ` paolo.carlini at oracle dot com
2013-06-11  8:59 ` paolo.carlini at oracle dot com
2013-06-11  9:39 ` nmm1 at cam dot ac.uk
2013-06-11  9:44 ` redi at gcc dot gnu.org
2013-06-11  9:51 ` jakub at gcc dot gnu.org
2013-06-11  9:54 ` redi at gcc dot gnu.org
2013-06-11 10:05 ` jakub at gcc dot gnu.org
2013-06-11 10:10 ` paolo.carlini at oracle dot com
2013-06-11 10:21 ` jakub at gcc dot gnu.org
2013-06-11 10:24 ` redi at gcc dot gnu.org
2013-06-11 11:08 ` nmm1 at cam dot ac.uk
2013-06-11 11:21 ` jakub at gcc dot gnu.org
2014-01-26  0:06 ` redi at gcc dot gnu.org
2014-01-26 10:19 ` redi at gcc dot gnu.org
2014-01-26 17:24 ` joseph at codesourcery dot com
2014-01-26 22:50 ` redi at gcc dot gnu.org
2021-04-19 10:40 ` redi at gcc dot gnu.org

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).