This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: Include guard conflict


Jan Van Dijk <janvandijkinjapan@yahoo.co.jp> writes:

> 	Hi all,
>
> when I compiled my code with g++ (mainline) I got horrible errors. The problem 
> turned out to be the changed include guards of the file bits/stl_vector.h.
>
> gcc-3.2 has: #ifndef __GLIBCPP_INTERNAL_VECTOR_H
> wheras mainline uses: #ifndef _VECTOR_H
>
> The latter was also used in my (numerical vector) header file, as a result its 
> contents were no longer included...

The C standard reserves all identifiers starting with _ for the C
Library.  I expect the C++ standard has similar wording.  So - if C++
has the same requirement -, using _VECTOR_H in one of your non-system
libraries is out of the spec and your code code is broken.

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Deutschherrnstr. 15-19, 90429 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


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