This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR libstdc++/19510: Uninitialized variable in someiterators
Jonathan Wakely wrote:
On Thu, Jan 20, 2005 at 07:11:28PM -0800, Mark Mitchell wrote:
My understanding is that the initialization being added is not required
by the standard for the library (as opposed to the part of the standard
that talks about acessing uninitialized values), but is required on
certain architectures where copying uninitialized values is not allowed.
The proposed resoltion to library DR 408, which Martin pointed out, says:
which implies it's an open issue whether uninit'd pointers are
copyable. I think this is also related:
The fact that the issue is open makes it even clearer that inserting
unconditional initializations on all platforms would be a mistake; we
might be pessimizing code in a way that is not required by the standard
on any platform.
As I think Gaby pointed out, debugging is easier if singular pointers
are set to zero, not some random bit pattern.
I'd be OK with having the pointers to be set to zero in a debugging
mode, although I should point out that people have rejected adding this
kind of feature to the compiler, on the grounds that it encourages
people to write unportable code that depends on the zero-initialization.