Issue |
123434
|
Summary |
[libc] PTHREAD_RWLOCK_INITIALIZER needs to initialize all members of `pthread_rwlock_t`
|
Labels |
libc
|
Assignees |
|
Reporter |
vinay-deshmukh
|
Building `llvm-libc`, when disabling `-Wno-missing-field-initializers` gives:
```
/home/runner/work/llvm-project/llvm-project/libc/test/integration/src/pthread/pthread_rwlock_test.cpp:59:29: error: missing field '__preference' initializer [-Werror,-Wmissing-field-initializers]
59 | pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER;
| ^
/home/runner/work/llvm-project/llvm-project/build/libc/include/llvm-libc-macros/pthread-macros.h:29:38: note: expanded from macro 'PTHREAD_RWLOCK_INITIALIZER'
29 | #define PTHREAD_RWLOCK_INITIALIZER {0}
| ^
/home/runner/work/llvm-project/llvm-project/libc/test/integration/src/pthread/pthread_rwlock_test.cpp:76:29: error: missing field '__preference' initializer [-Werror,-Wmissing-field-initializers]
76 | pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER;
| ^
/home/runner/work/llvm-project/llvm-project/build/libc/include/llvm-libc-macros/pthread-macros.h:29:38: note: expanded from macro 'PTHREAD_RWLOCK_INITIALIZER'
29 | #define PTHREAD_RWLOCK_INITIALIZER {0}
| ^
/home/runner/work/llvm-project/llvm-project/libc/test/integration/src/pthread/pthread_rwlock_test.cpp:86:29: error: missing field '__preference' initializer [-Werror,-Wmissing-field-initializers]
86 | pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER;
| ^
/home/runner/work/llvm-project/llvm-project/build/libc/include/llvm-libc-macros/pthread-macros.h:29:38: note: expanded from macro 'PTHREAD_RWLOCK_INITIALIZER'
29 | #define PTHREAD_RWLOCK_INITIALIZER {0}
| ^
/home/runner/work/llvm-project/llvm-project/libc/test/integration/src/pthread/pthread_rwlock_test.cpp:103:29: error: missing field '__preference' initializer [-Werror,-Wmissing-field-initializers]
103 | pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER;
| ^
/home/runner/work/llvm-project/llvm-project/build/libc/include/llvm-libc-macros/pthread-macros.h:29:38: note: expanded from macro 'PTHREAD_RWLOCK_INITIALIZER'
29 | #define PTHREAD_RWLOCK_INITIALIZER {0}
| ^
/home/runner/work/llvm-project/llvm-project/libc/test/integration/src/pthread/pthread_rwlock_test.cpp:133:29: error: missing field '__preference' initializer [-Werror,-Wmissing-field-initializers]
133 | pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER;
| ^
/home/runner/work/llvm-project/llvm-project/build/libc/include/llvm-libc-macros/pthread-macros.h:29:38: note: expanded from macro 'PTHREAD_RWLOCK_INITIALIZER'
29 | #define PTHREAD_RWLOCK_INITIALIZER {0}
| ^
/home/runner/work/llvm-project/llvm-project/libc/test/integration/src/pthread/pthread_rwlock_test.cpp:166:29: error: missing field '__preference' initializer [-Werror,-Wmissing-field-initializers]
166 | pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER;
| ^
/home/runner/work/llvm-project/llvm-project/build/libc/include/llvm-libc-macros/pthread-macros.h:29:38: note: expanded from macro 'PTHREAD_RWLOCK_INITIALIZER'
29 | #define PTHREAD_RWLOCK_INITIALIZER {0}
| ^
/home/runner/work/llvm-project/llvm-project/libc/test/integration/src/pthread/pthread_rwlock_test.cpp:207:29: error: missing field '__preference' initializer [-Werror,-Wmissing-field-initializers]
207 | pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER;
| ^
/home/runner/work/llvm-project/llvm-project/build/libc/include/llvm-libc-macros/pthread-macros.h:29:38: note: expanded from macro 'PTHREAD_RWLOCK_INITIALIZER'
29 | #define PTHREAD_RWLOCK_INITIALIZER {0}
```
Also, see: https://github.com/llvm/llvm-project/pull/122835#issuecomment-2597223393
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs