[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: (Re)Build problem with g++ 4.0

On Thu, 2005-07-07 at 23:57 +0200, Juergen Salk wrote:
> Hi,
> first of all: if this is not the appropriate list for this kind 
> of question, please give me pointer to better one.
> I am having problems with rebuilding my dcmtk package with g++
> 4.0 on Sid. The problem seems to be related to type casting
> between pthread_t and unsigned long int types and vice versa by 
> means of the `reinterpret_cast < > () operator'. With g++ 3.3 the 
> package builds fine right out of the box.
> Here is a bare bone example to illustrate the problem:

>     dummy = reinterpret_cast <unsigned long> (a_thread);

This should be a static_cast.  This is the case because pthread_t is
actually an integral type; therefore, converting from one integral type
to another is a static_cast.

On my machine (i386/sid and i386/experimental), the following is the
type of pthread_t:

typedef unsigned long int pthread_t;

> void *thread_func(void *arg) {
>     sleep(3);
>     pthread_exit(0);

You are also neglecting to return a value here.  You must always return
a value in a non-void function.


Attachment: signature.asc
Description: This is a digitally signed message part

Reply to: