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]

STL: warning: comparison between signed and unsigned


I get a lot of "warning: comparison between signed and unsigned"
warnings in the STL header files.  This is pretty annoying (especially
cause I insist on using -Werror).
Till now I fixed this every time by hand, but I wondered if it shouldn't
be fixed in the distribution too.

I am willing to supply a patch for the stl headers.

Comments?

-- 
 Carlo Wood  <carlo@runaway.xs4all.nl>

Example:

...
g++ -ggdb -Wall -Woverloaded-virtual -Wpointer-arith -Winline -Werror -pipe -fno-implicit-templates -fpic -I../../include -I. -I-  -c events.cc -o events.o
cc1plus: warnings being treated as errors
/usr/local/egcs-cvs/include/g++/stl_deque.h: In method `struct __deque_iterator<event_ct *,event_ct *&,event_ct **,0> deque<event_ct *,__default_alloc_template<true,0>,0>::erase<event_ct *, alloc, 0>(struct __deque_iterator<event_ct *,event_ct *&,event_ct **,0>, struct __deque_iterator<event_ct *,event_ct *&,event_ct **,0>)':
/usr/local/egcs-cvs/include/g++/stl_deque.h:420:   instantiated from `deque<event_ct *,__default_alloc_template<true,0>,0>::operator =<event_ct *, alloc, 0>(const deque<event_ct *,__default_alloc_template<true,0>,0> &)'
events.tig:2:   instantiated from here
/usr/local/egcs-cvs/include/g++/stl_deque.h:747: warning: comparison between signed and unsigned
/usr/local/egcs-cvs/include/g++/stl_deque.h: In method `void deque<event_ct *,__default_alloc_template<true,0>,0>::reserve_map_at_front<event_ct *, alloc, 0>(unsigned int = 1)':
/usr/local/egcs-cvs/include/g++/stl_deque.h:890:   instantiated from `deque<event_ct *,__default_alloc_template<true,0>,0>::push_front_aux<event_ct *, alloc, 0>(event_ct *const &)'
/usr/local/egcs-cvs/include/g++/stl_deque.h:454:   instantiated from `deque<event_ct *,__default_alloc_template<true,0>,0>::push_front<event_ct *, alloc, 0>(event_ct *const &)'
events.tig:2:   instantiated from here
/usr/local/egcs-cvs/include/g++/stl_deque.h:638: warning: comparison between signed and unsigned
/usr/local/egcs-cvs/include/g++/stl_deque.h: In method `struct __deque_iterator<event_ct *,event_ct *&,event_ct **,0> deque<event_ct *,__default_alloc_template<true,0>,0>::insert_aux<event_ct *, alloc, 0>(struct __deque_iterator<event_ct *,event_ct *&,event_ct **,0>, class event_ct *const &)':
/usr/local/egcs-cvs/include/g++/stl_deque.h:489:   instantiated from `deque<event_ct *,__default_alloc_template<true,0>,0>::insert<event_ct *, alloc, 0>(__deque_iterator<event_ct *,event_ct *&,event_ct **,0>, event_ct *const &)'
events.tig:2:   instantiated from here
/usr/local/egcs-cvs/include/g++/stl_deque.h:973: warning: comparison between signed and unsigned
/usr/local/egcs-cvs/include/g++/stl_deque.h: In method `void deque<event_ct *,__default_alloc_template<true,0>,0>::insert_aux<event_ct *, alloc, 0>(struct __deque_iterator<event_ct *,event_ct *&,event_ct **,0>, unsigned int, class event_ct *const &)':
/usr/local/egcs-cvs/include/g++/stl_deque.h:679:   instantiated from `deque<event_ct *,__default_alloc_template<true,0>,0>::insert<event_ct *, alloc, 0>(__deque_iterator<event_ct *,event_ct *&,event_ct **,0>, unsigned int, event_ct *const &)'
events.tig:2:   instantiated from here
/usr/local/egcs-cvs/include/g++/stl_deque.h:1003: warning: comparison between signed and unsigned
/usr/local/egcs-cvs/include/g++/stl_deque.h: In method `struct __deque_iterator<event_ct *,event_ct *&,event_ct **,0> deque<event_ct *,__default_alloc_template<true,0>,0>::erase<event_ct *, alloc, 0>(struct __deque_iterator<event_ct *,event_ct *&,event_ct **,0>)':
events.tig:2:   instantiated from here
/usr/local/egcs-cvs/include/g++/stl_deque.h:533: warning: comparison between signed and unsigned
make[2]: *** [events.o] Error 1
make[2]: Leaving directory `/home/carlo/c++/libr/src/kernel'
make[1]: *** [.build] Error 2
make[1]: Leaving directory `/home/carlo/c++/libr/src'
make: *** [build] Error 2



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