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: std::list iterator not dereferencable


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


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