This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 3.0.2: errno conflict.
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- To: Joe Buck <jbuck at synopsys dot com>
- Cc: max at e-soft dot ru (Maxim Dementiev), gcc at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: 15 Dec 2001 14:47:47 +0100
- Subject: Re: GCC 3.0.2: errno conflict.
- Organization: CodeSourcery, LLC
- References: <200112142351.PAA26215@atrus.synopsys.com>
Joe Buck <jbuck@synopsys.COM> writes:
| [ this discussion was on gcc, I'm adding libstdc++ ]
|
| Maxim Dementiev writes:
|
| > Excuse me if this bug is wellknown for peaple.
| > This code copile with error by g++ 3.0.2 on Linux 2.2.19 (i386).
| > (See commented line below.)
| > If rename "errno" to "errno1" - all works fine.
| > Is it a bug?
|
| [ testcase uses errno as an identifier, and there is a collision with
| the errno macro in glibc, but the only #include was for <iostream> ]
|
| I think that the conclusion is that, since you did not include <errno.h>
| or <cerrno> explicitly, there is a bug.
No, the C++ standard explicitly grants right to standard headers
(except those inherited from C and the <cxxx> variants) to #include
any other header. A well wriitten C++ program should not make any
assumption about which header #includes which. From that point of
view, I would say the testcase is ill-designed.
-- Gaby
CodeSourcery, LLC http://www.codesourcery.com