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

bug report




To whom it may concern:

I am having some compile warnings when I use STL deques (or containers
based on deques) in C++ applications.  I am not sure if you were aware of
them but I wanted to at least make them known.

Operating system:  AIX 4.2.1.0
G++ version:   2.95.2 (also, 2.91.66 and 2.91.60 had similar issues)
Compilation command:  g++ -Wall -pedantic

Problem encountered:
Comparisons between signed and unsigned in
/usr/local/include/g++-3/stl_deque.h.

1.  At line 1051, in the statement "if (__elems_before < (size() - __n) /
2)",
     of method deque::iterator deque::erase()
     __elems_before is of type difference_type, which is a typedef of
ptrdiff_t, which is a typedef of int
     size() returns a size_type, which is a typedef of size_t, which is a
typedef of unsigned long
2.  At line 1406, in the statement "if (__elemsbefore < __length / 2)",
     of method void deque::_M_insert_aux()
     __elemsbefore is of type difference_type, which is a typedef of
ptrdiff_t, which is a typedef of int
     __length is of type size_type, which is a typedef of size_t, which is
a typedef of unsigned long


If this is not a bug, can you please advise as to the best method of
resolving the warnings?


Thank you for your tremendous efforts over the years.


-Matt Ryan
IBM Global Services C++ OOADD Software Engineer
RepliData UNIX Development Team
mattryan@us.ibm.com



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