This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Fix PR libstdc++/19510: Uninitialized variable in someiterators
- From: Volker Reichelt <reichelt at igpm dot rwth-aachen dot de>
- To: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org, gdr at integrable-solutions dot net
- Date: Thu, 20 Jan 2005 20:03:42 +0100 (CET)
- Subject: Re: [PATCH] Fix PR libstdc++/19510: Uninitialized variable in someiterators
Martin Sebor pointed to
http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#408
where we have:
Issue 235, which defines reverse_iterator's default constructor more
precisely, has some relevance to this issue. However, it is not the
whole story.
The issue was whether
reverse_iterator() { }
is allowed, vs.
reverse_iterator() : current() { }
The difference is when T is char*, where the first leaves the member
uninitialized, and possibly equal to an existing pointer value, or
(on some targets) may result in a hardware trap when copied.
Or for short: Copying uninitialized pointers may result in a hardware trap.
This means we really should do the initialization in 3.4, not only for the
sake of easier debugging.
OK if I prepare a patch for 3.3, too?
Regards,
Volker