Some defines in nptl/sysdeps/pthread/pthread.h have empty initializers. This lead to problems compiling files with pthread.h included and -Wall -Werror, like boehm-gc: pthread_support.c:1495: warning: ISO C forbids empty initializer braces pthread_support.c:1498: warning: ISO C forbids empty initializer braces
And what is on the quoted lines in those files? If I don't get a self-contained test case I'll close the bug.
Created attachment 475 [details] uses PTHREAD_MUTEX_INITIALIZER and PTHREAD_COND_INITIALIZER
Ok, the problem is -pedantic not -Wall. $ gcc -pedantic -c test.c test.c: In function `main': test.c:5: warning: ISO C forbids empty initializer braces test.c:6: warning: ISO C forbids empty initializer braces
I've checked in a patch although the -pedantic option shouldn't be used.
Subject: Bug 915 CVSROOT: /cvs/glibc Module name: libc Branch: glibc-2_3-branch Changes by: roland@sources.redhat.com 2005-07-18 03:20:13 Modified files: nptl/sysdeps/pthread: pthread.h Log message: 2005-07-11 Jakub Jelinek <jakub@redhat.com> [BZ #1102] * sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP, PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER, PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP, PTHREAD_COND_INITIALIZER): Supply zeros for all fields in the structure. * Makefile (tests): Add tst-initializers1. (CFLAGS-tst-initializers1.c): Set. * tst-initializers1.c: New test. 2005-05-03 Ulrich Drepper <drepper@redhat.com> [BZ #915] * sysdeps/pthread/pthread.h: Avoid empty initializers. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/nptl/sysdeps/pthread/pthread.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.30.2.1&r2=1.30.2.2