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 target/24012] [5/6/7 regression] #define _POSIX_C_SOURCE breaks #include <iostream>


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

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