This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: std::list iterator not dereferencable
- From: Mateusz Åoskot <mateusz at loskot dot net>
- To: libstdc++ at gcc dot gnu dot org
- Date: Mon, 27 Mar 2006 04:42:44 +0200
- Subject: Re: std::list iterator not dereferencable
- Openpgp: id=BB2AC1F2; url=http://mateusz.loskot.net/pgp.asc
- References: <442720B0.9080605@loskot.net> <20060327011708.GA24008@synopsys.com>
Joe Buck wrote:
> On Mon, Mar 27, 2006 at 01:16:00AM +0200, Mateusz Åoskot wrote:
>> Today, I tried to build some Linux application using VC++ 7.1/8.0
>> and I encountered strange GCC 3.2.3 behaviour that make me thinking
>> about possible bug in GCC (or libstdc++, I'm not sure).
>
> As you say, your code is invalid: the iterator points to an object
> that has been destroyed. The behavior of different compilers on
> invalid code is likely to depend on implementation details; it is not
> a bug that you see differences.
I understand it.
Now it seems obvious to me, that "undefined behaviour" is undefined, so
may cause different results on different compilers/platforms.
That seems to be reasonable.
Thanks
--
Mateusz Åoskot
http://mateusz.loskot.net