Manolis Ragkousis, on Fri 14 Oct 2016 16:42:42 +0300, wrote:
> ../libpthread/sysdeps/hurd/pt-key.h: In function ‘__pthread_key_lock_ready’:
> ../libpthread/sysdeps/pthread/bits/once.h:32:10: error: initializer
> element is not constant
>   (struct __pthread_once) { 0, __PTHREAD_SPIN_LOCK_INITIALIZER }
>           ^
> ../libpthread/include/pthread/pthread.h:757:27: note: in expansion of
> macro ‘__PTHREAD_ONCE_INIT’
>  #define PTHREAD_ONCE_INIT __PTHREAD_ONCE_INIT
>                            ^
> ../libpthread/sysdeps/hurd/pt-key.h:55:29: note: in expansion of macro
> ‘PTHREAD_ONCE_INIT’
>    static pthread_once_t o = PTHREAD_ONCE_INIT;

That's odd, I'm not getting such error. This really is constant...

Does the attached program fail to build too?  It should be equivalent
to the libpthread code at stake.

Samuel
typedef volatile int fooo;

struct foo {
        int i;
        fooo j;
};

static struct foo bar = (struct foo) { 0, ((fooo) 0)};

int main(void) {
}

Reply via email to