GCC 3.0.2: errno conflict.
Gabriel Dos Reis
gdr@codesourcery.com
Sat Dec 15 05:56:00 GMT 2001
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
More information about the Gcc
mailing list