This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/36231] ostream includes unistd.h outside namespace std, polluting
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Apr 2010 14:24:17 -0000
- Subject: [Bug libstdc++/36231] ostream includes unistd.h outside namespace std, polluting
- References: <bug-36231-6594@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from igodard at pacbell dot net 2010-04-30 14:24 -------
This is not a fault of POSIX, because I'm *not* using POSIX. I'm using C++
ostream. Because I'm not using POSIX I expect to be able to declare (for
example) "int open = 0;" without a problem - "open" is not a reserved key word
and I'm not #including anything that is *defined* to transitively include a
POSIX header. According to my reading of the standard, all standard libraries
must export only the names defined by the standard, and any other names they
need must be guarded by leading underscores or be within a similarly guarded
namespace that has not been opened by "using". My report says that gcc violates
that standard, because it gratuitously dumps POSIX names into my global space.
Of course, I may be wrong in my interpretation of the standard - I have been
many times before :-)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36231