This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/24012] [5/6/7 regression] #define _POSIX_C_SOURCE breaks #include <iostream>
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 28 Mar 2017 15:15:48 +0000
- Subject: [Bug target/24012] [5/6/7 regression] #define _POSIX_C_SOURCE breaks #include <iostream>
- Auto-submitted: auto-generated
- References: <bug-24012-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24012
--- Comment #22 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #20)
> Also, I assume this is only a problem for -std=c++98 or -std=gnu++98,
> because if the system headers don't declare those functions for C++11 and
> later dialects then that's a bug in those system headers.
That's not true, because we (rather bizarrely) do this:
#if _GLIBCXX_HAVE_WCSTOF
#undef wcstof
#endif
namespace std {
#if _GLIBCXX_HAVE_WCSTOF
using ::wcstof
#endif
}
#if __cplusplus >= 201103L
namespace std {
#if _GLIBCXX_HAVE_WCSTOF
using std::wcstof
#endif
}
#endif
This means we unconditionally try to declare them in namespace std, then for
C++11 redeclare std::wcstof as std:wcstof (???).