This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR libstdc++/19510: Uninitialized variable in someiterators
- From: Chris Jefferson <caj at cs dot york dot ac dot uk>
- To: Volker Reichelt <reichelt at igpm dot rwth-aachen dot de>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Thu, 20 Jan 2005 16:00:12 +0000
- Subject: Re: [PATCH] Fix PR libstdc++/19510: Uninitialized variable in someiterators
- References: <200501200144.j0K1iXBR000835@relay.rwth-aachen.de>
Volker Reichelt wrote:
Just one extra note. This code is actually undefined, as the
initalisation of the std::vector is copying a std::list<int>::iterator.
This is caught if you compile and execute using the the debugging
version of libstdc++. This is no reason to not default-initalise of
course (and I think we should), but any code that triggers this bug is
using undefined behaviour (sorry if this was already obvious to everyone
else, I only just found out it's undefined behaviour if you copy an
uninitalized pointer, you learn something new every day).
PR libstdc++/19510 is about a warning that is triggered from within the
libstdc++ headers. When compiling the following code snippet with
"-Wall -O3" using mainline
the following warning is issued:
/long_path/stl_construct.h: In function 'void
/long_path/stl_construct.h:81: warning: 'SR.133' is used uninitialized in this