egcs-1.0.2: Lots of warnings from STL header files

Munagala V. S. Ramanath ram@netcom.com
Thu Apr 23 15:01:00 GMT 1998


This tiny program produces a plethora of warnings from STL header files
when compiled with options "-O2 -Wall" by egcs-1.0.2:

gcc -Wall -O2 bug6.C -lstdc++
/d2a/exper/include/g++/stl_tree.h: In method `struct __rb_tree_iterator<pair<const int,A>,pair<const int,A> &,pair<const int,A> *> rb_tree<int,pair<const int,A>,select1st<pair<const int,A> >,less<int>,__default_alloc_template<false,0> >::__insert(struct __rb_tree_node_base *, struct __rb_tree_node_base *, const struct pair<const int,A> &)':
/d2a/exper/include/g++/stl_tree.h:442: warning: `struct __rb_tree_node<pair<const int,A> > * tmp' might be used uninitialized in this function
/d2a/exper/include/g++/stl_tree.h:444: warning: `struct pair<const int,A> * p' might be used uninitialized in this function
/d2a/exper/include/g++/stl_construct.h:45: warning: `void * place' might be used uninitialized in this function
/d2a/exper/include/g++/stl_tree.h:446: warning: `struct cp_eh_info * __exception_info' might be used uninitialized in this function
/d2a/exper/include/g++/stl_tree.h:446: warning: `struct __rb_tree_node<pair<const int,A> > * p' might be used uninitialized in this function
/d2a/exper/include/g++/stl_tree.h:439: warning: `struct __rb_tree_node<pair<const int,A> > * p' might be used uninitialized in this function
/d2a/exper/include/g++/stl_alloc.h:227: warning: `void * p' might be used uninitialized in this function
/d2a/exper/include/g++/stl_alloc.h:422: warning: `void * p' might be used uninitialized in this function
/d2a/exper/include/g++/stl_tree.h:442: warning: `struct __rb_tree_node<pair<const int,A> > * tmp' might be used uninitialized in this function
/d2a/exper/include/g++/stl_tree.h:444: warning: `struct pair<const int,A> * p' might be used uninitialized in this function
/d2a/exper/include/g++/stl_construct.h:45: warning: `void * place' might be used uninitialized in this function
/d2a/exper/include/g++/stl_tree.h:446: warning: `struct cp_eh_info * __exception_info' might be used uninitialized in this function
/d2a/exper/include/g++/stl_tree.h:446: warning: `struct __rb_tree_node<pair<const int,A> > * p' might be used uninitialized in this function
/d2a/exper/include/g++/stl_tree.h:439: warning: `struct __rb_tree_node<pair<const int,A> > * p' might be used uninitialized in this function
/d2a/exper/include/g++/stl_alloc.h:227: warning: `void * p' might be used uninitialized in this function
/d2a/exper/include/g++/stl_alloc.h:422: warning: `void * p' might be used uninitialized in this function

Version, platform etc. :

Reading specs from /d2a/exper/lib/gcc-lib/sparc-sun-sunos4.1.2/egcs-2.90.27/specs
gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)

Here is the program:

----------  CUT HERE  ----------------------------  CUT HERE  ----------
// This generates a lot of warnings from stl header files when compiled
// with egcs-1.0.2 with options "-O2 -Wall"

#include <stl.h>
struct A {
    int i ;
    A( ) : i(0) { }
};
map< int, A > amap;
int main() { amap[ 0 ] = A() ; }



More information about the Gcc-bugs mailing list