Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2004-10-05 10:06:44


> When compiling the smart pointer tests with gcc 3.4.2 on Tru64, two tests
> fail with an error message. (See http://tinyurl.com/4jngu )
>
> As far as I can see, the shared pointer implementation at some point
> includes the "pthread.h" system header file but gcc on Tru64 requires
> that -pthread must be specified on the command line when including this
> header file.
>
> When running this test with gcc 3.4.2 on Linux the file "pthread.h" is
> also included but gcc doesn't require the addition of -pthread in the
> command line on this platform.
>
> This leads to the question whether it is ok to include "pthread.h" without
> specifying -pthread on the command line. Does anyone know an answer to
> this?

I think on some platforms <pthread.h> doesn't compile unless _REENTRANT or
some similar compiler-specific magic symbol is defined: in other words it's
an assert that the compiler is indeed in thread safe mode.

It looks to me as though BOOST_HAS_THREADS is getting set unconditionally
for gcc on this platform, and presumably we should only set it when
_REENTRANT is defined (I'm assuming that's the symbol that gets defined when
the -thread option is used - can you check?).

Hold on... checked the output from config_info and looks as though
_REENTRANT *is* defined, so I'm mystified. I also note that the platform is
detected as "generic unix". Do you know what macros gcc defines to identify
this platform?

Thanks,

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk