Strange warning (variable might be clobbered by `longjmp' or `vfork')
Jeffrey A Law
law@cygnus.com
Sat Nov 1 21:24:00 GMT 1997
In message <9709010239.AA21568@beeblebrox-84.synopsys.com>you write:
> It is not clear to me that it represents an actual bug (that is, that in
> the execution of the programs where we've seen these messages, that any
> flow is possible that accesses the automatic variables being warned about
> after setjmp catches a longjmp. The compiler issues the warning because
> it cannot prove this; it may be being overly conservative.
Just a note -- I've fixed the flow control problems, so many/most
of the bogus warnings about clobbered by setjmp and such should
be gone in the next snapshot.
> For example, cd to egcs-97XXXX/libstdc++/tests and say
>
> gcc -c -O -Wall tmap.cc
Well, I get the following on my linux box after fixing the flow
control problems. So, there's still at least one problem with the
flow control graph, but it's a whole lot better than before!
/usr/egcs/include/g++/tree.h: In method `struct __rb_tree_node<pair<const int,int> > * rb_tree<int,pair<const int,int>,select1st<pair<const int,int> >,int_less,__default_alloc_template<false,0> >::create_node(const struct pair<const int,int> &)':
/usr/egcs/include/g++/tree.h:447: warning: control reaches end of non-void function `rb_tree<int,pair<const int,int>,select1st<pair<const int,int> >,int_less,__default_alloc_template<false,0> >::create_node(const pair<const int,int> &)'
/usr/egcs/include/g++/tree.h: In method `struct __rb_tree_node<pair<char *const,int> > * rb_tree<char *,pair<char *const,int>,select1st<pair<char *const,int> >,str_less,__default_alloc_template<false,0> >::create_node(const struct pair<char *const,int> &)':
/usr/egcs/include/g++/tree.h:447: warning: control reaches end of non-void function `rb_tree<char *,pair<char *const,int>,select1st<pair<char *const,int> >,str_less,__default_alloc_template<false,0> >::create_node(const pair<char *const,int> &)'
%
Jeff
More information about the Gcc
mailing list