Re: gcc optimizer bug with Boost ?
Re: gcc optimizer bug with Boost ?
- Subject: Re: gcc optimizer bug with Boost ?
- From: Andrew Kimpton <email@hidden>
- Date: Thu, 12 Feb 2004 19:50:04 -0800
To answer my own question :
From: Andrew Kimpton <email@hidden>
Subject: gcc optimizer bug with Boost ?
Date: Tue, 3 Feb 2004 17:01:58 -0800
I'm having a problem with boost shared_ptr's and some code built using
XCode 1.1. A member variable (a pointer) inside the boost::
sp_counted_base_impl seems to be getting corrupted with optimization
set to -01 or higher.
The problem actually turned out to be with the BOOST_HAS_THREADS
#define being defined differently between two files due to the order of
including the boost headers vs. the Carbon framework headers.
The Boost 1.30.0 (and later I think) headers include posix headers
*unless* TARGET_CARBON is defined. The boost posix feature checking in
turn detects pthreads and defines the BOOST_HAS_THREADS macro. Since I
had some files where the boost headers were included before the carbon
framework BOOST_HAS_THREADS was true, in other places it wasn't since
the order was reversed. This meant that boost objects with mutex
members may have been created with the mutex in some scenarios and
without in others. Worse some objects were created in one situation and
deleted in the opposite situation which resulted in what looked like a
corrupted (actually uninitialized) member variable in an objects
destructor.
Andrew 8-)
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.