Your message dated Fri, 28 Jul 2006 19:56:47 +0200
with message-id <[EMAIL PROTECTED]>
and subject line [pkg-boost-devel] Bug#379897: boost compiles differently, if 
ACE header is included first
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: libboost-dev
Version: 1.32.0-6


This also relies to package libace-dev version 5.4.2.1.0-4.

Consider the following program boostfirst.cpp:
------------------------------------------------------------
#include <boost/shared_ptr.hpp>
#include <ace/OS.h>
#include <iostream>

using namespace std;

int main (int argc, char **argv)
{
    cout << "sizeof (boost::detail::sp_counted_base) == "
        << sizeof (boost::detail::sp_counted_base) << endl;
}
------------------------------------------------------------

Compile and run with:

$ g++ boostfirst.cpp -o boostfirst -lstd
$ ./boostfirst
sizeof (boost::detail::sp_counted_base) == 12


Now try including the ace header first (only the order of
the include files is changed):
------------------------------------------------------------
#include <ace/OS.h>
#include <boost/shared_ptr.hpp>
#include <iostream>

using namespace std;

int main (int argc, char **argv)
{
    cout << "sizeof (boost::detail::sp_counted_base) == "
        << sizeof (boost::detail::sp_counted_base) << endl;
}
------------------------------------------------------------

The output of the second program is:
sizeof (boost::detail::sp_counted_base) == 36

A great difference. The reason for this is, that the
#include <ace/OS.h> somehow defines _REENTRANT, which
triggers the boost library to include a mutex in
sp_counted_base. I think, the order of the includes
should not matter. Therefore, either '#include <ace/OS.h>'
should not define _REENTRANT, or the boost headers
should ignore it.

I found out, that adding the -pthread option to the
g++ command also avoids this bug.

Im using Debian sarge 3.1, g++ 3.3.5-3, libc6 2.3.2.ds1-22sarge3
and libace-dev 5.4.2.1.0-4.




--- End Message ---
--- Begin Message ---
On Wed, Jul 26, 2006 at 10:36:56AM +0200, Harling, Torsten wrote:
>
...
> A great difference. The reason for this is, that the
> #include <ace/OS.h> somehow defines _REENTRANT, which
> triggers the boost library to include a mutex in
> sp_counted_base. I think, the order of the includes
> should not matter. Therefore, either '#include <ace/OS.h>'
> should not define _REENTRANT, or the boost headers
> should ignore it.

hi :)

  how this can be a boost's fault? there is a lot of code that compiles
differently in base of _REENTRANT. is it all broken?

if this surprises you, you didn't read ACE documentation or it does
not explain this nice side-effect of OS.h. anyway this is not related
with boost.

i'm closing the report.

cheers
domenico

-----[ Domenico Andreoli, aka cavok
 --[ http://people.debian.org/~cavok/gpgkey.asc
   ---[ 3A0F 2F80 F79C 678A 8936  4FEE 0677 9033 A20E BC50

--- End Message ---

Reply via email to