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: Error in stl_bvector.h and vector.tcc


sabba.hillel@verizon.net said:
> The following code causes gcc-3.4.0 to find a compile error in
> stl_bvector.h and vector.tcc
>
> [ Code elided ]
>
> If the vector line is moved before the max, min definitions, the error
> does not occur.  if the fstream include is removed, the error does not
> occur. 

Without even trying to compile your code, I can tell you that 
defining macros whose names are min and max is asking for trouble.
There are some std::min and std::max functions and the headers 
defining those are certainly included somehow by vector and fstream.

so instead of std::max(i,j) you got std::( ((i) > (j)) ? (i) : (j) )

This occurs a few times in vector.

Why it does not occur if you remove the fstream is more puzzling. I 
suspect that stl_algo.h (where the min and max c++ function are 
defined, undefines your definitions for min and max and that what the 
error disappears...

	Theo.

--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
 --------------------------------------------------------------------



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