+++ This bug was initially created as a clone of Bug #162722 +++ Description: Compiling code with '-W' causes warnings due to the static mutex initializer macros not being complete/correct. Release: Fedora Core 4. Reproducible: Easily reproduced with the code below and also attached. #include <stdio.h> #include <pthread.h> static pthread_mutex_t some_static_mutex = PTHREAD_MUTEX_INITIALIZER; //static pthread_rwlock_t some_static_rwmutex = PTHREAD_RWLOCK_INITIALIZER; static pthread_cond_t some_static_condition = PTHREAD_COND_INITIALIZER; int main(int argc, char ** argv) { fprint("compiler error above if compiled with -W option\n"); } /* gcc -W fc4-gcc4-mutex.c -c fc4-gcc4-mutex.c:4: warning: missing initializer fc4-gcc4-mutex.c:4: warning: (near initialization for 'some_static_mutex.__data.__count') fc4-gcc4-mutex.c:6: warning: missing initializer fc4-gcc4-mutex.c:6: warning: (near initialization for 'some_static_condition.__data.__futex') NOTE: I believe the pthread_rwlock_t has the same issue but I do not use it in my project so I didn't test it. */ Steps to Reproduce: 1. cut/paste the above code into a file called 'fc4-gcc4-mutex.c' 2. run 'gcc -W -c fc4-gcc4-mutex.c' I like 'gcc -W -Wall -Werror -c fc4-gcc4-mutex.c' Actual results: fc4-gcc4-mutex.c:4: warning: missing initializer fc4-gcc4-mutex.c:4: warning: (near initialization for 'some_static_mutex.__data.__count') fc4-gcc4-mutex.c:6: warning: missing initializer fc4-gcc4-mutex.c:6: warning: (near initialization for 'some_static_condition.__data.__futex') Expected results: No warnings and successful compile. Additional info:
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2005-678.html