Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost Graph Very Strange Behavior
From: Alexander Feldman (alex_at_[hidden])
Date: 2011-08-21 02:37:33


On 08/21/2011 01:03 AM, Jeremiah Willcock wrote:
> On Sun, 21 Aug 2011, Alexander Feldman wrote:
>
>> Dear All,
>>
>> I have upgraded to Boost 1.47.0 and I have spent a day on the
>> following strange behavior that someone who knows Boost better may
>> explain to me. Consider the source below. If I uncomment the line:
>>
>> //cout << "";
>>
>> in line 39, then the program starts working, i.e., it outputs:
>>
>> 0x1
>>
>> If I comment out line 39, then I get
>>
>> 0
>>
>> There are no memory leaks.
>>
>> This kind of stuff gives me nightmares.
>>
>> Thanks for your help and sorry for the longish example.
>
> I tried your example with GCC 4.6 on Linux and it worked just fine, both
> with and without the printout. BTW, it is not recommended to inherit
> from BGL (or STL) objects since they do not have virtual destructors and
> are not meant for that usage.

I have just figured out that the problem appears with gcc 4.5.2 -O2 and
the program runs fine with -O1. I think now, it is something related to
inlining but I will investigate further.

Thanks for the advise not inherit from BGL - will change that.

Best,

-- Alex

>
> -- Jeremiah Willcock
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net