This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

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


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-01-26
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #28 from Jonathan Wakely <redi at gcc dot gnu.org> ---
PR 11196 is another example of the same general issue.

In addition to the uselocale stuff mentioned in comment 21 ...

<ext/stdio_sync_filebuf.h> uses ftello64, fseeko64, etc. If glibc provided
__ftello64 etc instead we could use them, but another option that works now is
to define only _LARGEFILE64_SOURCE, rather than everything implied by
_GNU_SOURCE.

-std=c++11 and -std=gnu++11 need to define _ISOC99_SOURCE, and libstdc++ should
have a replacement for _GLIBCXX_USE_C99 so that it isn't true for -std=c++98
(but would be for -std=gnu++98, since that would define _GNU_SOURCE which
includes the C99 library anyway).

gthr-posix.h needs some _XOPEN_SOURCE value.

<util/testsuite_hooks.h> uses pid_t which needs a POSIX/XOPEN/BSD/GNU feature
macro (which would be OK except that at least one tests uses -std=c++11 when it
should probably use -std=gnu++11)

So *most* of what we need is provided by _ISOC99_SOURCE and _LARGEFILE64_SOURCE
and POSIX. It's probably acceptable (and certainly more correct) not to define
_GLIBCXX_USE_C99 with -std=c++98 and figure out the few C99 functions that we
absolutely must have even in strict c++98 mode and find workarounds for them.

I'll look at this after GCC 4.9 is released.


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