public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* obviously bogus 'might be used uninitialized' warning, g++ 3.4.3
@ 2005-05-23  2:15 ben f
  0 siblings, 0 replies; only message in thread
From: ben f @ 2005-05-23  2:15 UTC (permalink / raw)
  To: gcc-help

I have seen a series of bogus 'might be used 
uninitialized' errors, and tried to encapsulate them
into a simple example... unfortunately, the simplest
one shows the error occurring in stl header code, but
it's trivial to reproduce against g++ 3.4.3 on
openbsd.
I have no access to other g++ on other OSes atm.

the source:
$ cat t.cc
#include <string>
#include <vector>
int main(int argc, char *argv[])
{
    std::vector<std::string> strvec;
    strvec.resize(10);
    return (0);
}

$ eg++ -c -O2 -Wall -Werror t.cc
/usr/local/lib/gcc/i386-unknown-openbsd3.6/3.4.3/../../../../include/c++/3.4.3/bits/stl_uninitialized.h:
In member function `void std::vector<_Tp,
_Alloc>::_M_fill_insert(__gnu_cxx::__normal_iterator<typename
_Alloc::pointer, std::vector<_Tp, _Alloc> >, size_t,
const _Tp&) [with _Tp = std::string, _Alloc =
std::allocator<std::string>]':
/usr/local/lib/gcc/i386-unknown-openbsd3.6/3.4.3/../../../../include/c++/3.4.3/bits/stl_uninitialized.h:82:
warning: '__cur' might be used uninitialized in this
function
/usr/local/lib/gcc/i386-unknown-openbsd3.6/3.4.3/../../../../include/c++/3.4.3/bits/stl_uninitialized.h:82:
warning: '__cur' might be used uninitialized in this
function

adding -Wno-uninitialized gets rid of the problem,
as does removing -O2 (expectedly).

is this a real bug?  i spent some time searching
gcc's bugzilla and gcc/gcc-help/gcc-bugs mailing
lists, but so far have found nothing that looks
like this.  i'm building a 3.4.4 release as i type
to see if it exists there as well.

if it is real, what ought i do next?  please cc: any
responses to me directly.  thanks.

ben


		
__________________________________ 
Do you Yahoo!? 
Make Yahoo! your home page 
http://www.yahoo.com/r/hs

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-05-23  2:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-23  2:15 obviously bogus 'might be used uninitialized' warning, g++ 3.4.3 ben f

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).