This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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:
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#240

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.


--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]