When building with "... -g0 -DNDEBUG -Wall -Wextra -Wpedantic" then the
following error happens:
../../../gcc_trunk/libatomic/config/posix/lock.c: At top level:
../../../gcc_trunk/libatomic/config/posix/lock.c:58:3: warning: missing
initializer for field 'pad' of 'struct lock' [-Wmissing-field-initializers]
[0 ... NLOCKS-1].mutex = PTHREAD_MUTEX_INITIALIZER
^
The folowing patch fixes it.
Regtested x86_64-linux.
NOT committed b/c don't have write access yet.
2018-06-25 U.Mutlu <u...@mutluit.com>
* config/posix/lock.c: fix to [-Wmissing-field-initializers] when
building with "... -g0 -DNDEBUG -Wall -Wextra -Wpedantic"
Index: libatomic/config/posix/lock.c
===================================================================
--- libatomic/config/posix/lock.c (revision 261994)
+++ libatomic/config/posix/lock.c (working copy)
@@ -55,7 +55,8 @@
#define NLOCKS (PAGE_SIZE / WATCH_SIZE)
static struct lock locks[NLOCKS] = {
- [0 ... NLOCKS-1].mutex = PTHREAD_MUTEX_INITIALIZER
+ [0 ... NLOCKS-1] = (struct lock)
+ { .mutex = PTHREAD_MUTEX_INITIALIZER, .pad[0] = 0 }
};
static inline uintptr_t