[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Cthreads to Pthreads code.
From: |
Marcus Brinkmann |
Subject: |
Re: Cthreads to Pthreads code. |
Date: |
Thu, 24 Oct 2002 09:57:38 -0400 |
User-agent: |
Mutt/1.4i |
On Thu, Oct 24, 2002 at 09:21:54AM +0200, Niels Möller wrote:
> Vicente Hernando Ara <zenton@es.gnu.org> writes:
>
> > * This last is an error I get in exec.c file.
> > static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
> > This trigger an error when compiling:
> > exec.c:1382: initializer element is not constant
> >
> > however:
> > pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
> > compiles ok. Why is that?
>
> Appearantly, PTHREAD_MUTEX_INITIALIZER is not a constant expression.
> Perhaps that's a bug, I'd expect the pthreads spec to require that
> it's constant, but I haven't read that.
It was an early bug in Neals code, which made it a compound statement
(Neal was trying to make soemthing that looks like a struct foo cast,
but that makes it a compound statement, and that is not constant, see
the discussion from gcc bug list that was CC'ed here a few weeks ago).
I think it is fixed in CVS by now, but I can not check. In fact, I am
not here. You didn't see this email :)
Thanks,
Marcus