This is the mail archive of the gcc@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]

Re: GCC 3.0.2: errno conflict.


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


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