This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR libstdc++/19510: Uninitialized variable in someiterators
Gabriel Dos Reis wrote:
Chris Jefferson <firstname.lastname@example.org> writes:To be honest, I perfer to initalise these things :)
| >We have a default-initialisation (to zero in this case), rather than an
| >indeterminate value. IMHO any slight overhead is worth it.
| Hmm.. I would tend to say the "C++" way was to never default initalise
well, that is not "C++" way. That is something inherited from C, and
preseved there more for inertia or alleged efficiency of POD in
general than in specific cases at hand. Here we're talking about
inline initialization of a class member. I also see no reason to dump
annoying messages on users about which he/she can do nothing.
How do you know under the debugger that a list iterator is singular?
Do you prefer to see a null pointer value or some values you cannot
say off hand are valid or not?
However, with regards sending this back to 3.4, I'm not convinced it's
an actual bug, although it is likely to lead to more informative
debugging / less memory corruption (no-one should be counting on the
iterator pointing at NULL of course). However if it is in fact safe to
send back there as you say, I don't see why not.