Hello,

Petter Reinholdtsen, le lun. 06 avril 2026 11:48:28 +0200, a ecrit:
> According to
> <URL: 
> https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/pthread_once.html
>  >
> the value of PTHREAD_ONCE_INIT should be constant.  Is it not so on GNU
> Hurd?  I fail to understand how { 0, 0} is not constant,

It is, but (pthread_once_t){0,0} is a different thing.

And the issue is that while

>   x.c:3:32: error: initializer element is not constant [-Werror=pedantic]
>       3 |   static pthread_once_t once = PTHREAD_ONCE_INIT;

can work with PTHREAD_ONCE_INIT being defined to {0,0},

once = PTHREAD_ONCE_INIT

cannot work, even without pedantic. So we really have to keep
(pthread_once_t) in PTHREAD_ONCE_INIT for the dynamic initialization
case.

That being said, it's *really* odd that the package builds with
-Werror=pedantic. Each time gcc gets upgraded to a new version, it will
get new build failures... We'd probably to disable that in the Debian
build.

Samuel

Reply via email to