This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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


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



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