Skip to content

[libc] PTHREAD_RWLOCK_INITIALIZER needs to initialize all members of pthread_rwlock_t #123434

@vinay-deshmukh

Description

@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: #122835 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions