Boost logo

Boost :

From: Jonathan Wakely (cow_at_[hidden])
Date: 2004-10-05 10:09:37


On Tue, Oct 05, 2004 at 03:05:13PM +0200, Markus Sch?pflin wrote:

> 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.

Markus, I believe what you're seeing is the problem that prompted the
GCC developers to unconditionally define _REENTRANT even when -pthread
is not given (and which breaks Boost for GCC 3.4), see
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11953

Technically, Tru64's pthread.h doesn't require -pthread, it requires
_REENTRANT. -pthread on Tru64 defines _REENTRANT, but if you want to
include the file without having to use -pthread then just ensure
_REENTRANT is defined.

The solution that libstdc++ uses is to ensure _REENTRANT is defined
before including pthread.h. That allows the file to be included without
having to link to the pthread libs etc. (I think).

Now if only they'd fix libstdc++ so _REENTRANT only gets defined on OSF,
not on Linux and other platforms that don't require it!

jon

> 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?

-- 
"Anybody who hates dogs and loves whiskey can't be all bad."
	- W.C. Fields

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