Skip to content
Commit a3aaa598 authored by Adhemerval Zanella's avatar Adhemerval Zanella
Browse files

nptl: Add workaround for ASSERT_PTHREAD_INTERNAL_SIZE with GCC 4.9

GCC 4.9 (the minimum current supported) emits an warning for universal
zero initializer ({0}) on ASSERT_PTHREAD_INTERNAL_SIZE:

pthread_attr_init.c: In function ‘__pthread_attr_init_2_1’:
pthread_attr_init.c:37:3: error: missing braces around initializer [-Werror=missing-braces]
   ASSERT_PTHREAD_INTERNAL_SIZE (pthread_attr_t, struct pthread_attr);
   ^
pthread_attr_init.c:37:3: error: (near initialization for ‘(anonymous).__size’) [-Werror=missing-braces]

It is fact GCC BZ#53119 [1] fixed in later version (GCC5+).  Since
current branch is closed and there is no indication it will be backports
(comment #20 in same bug report) this patch fixes by using a double
bracket to zero initialize the struct.

Checked on x86_64-linux-gnu with GCC 7 and GCC 4.9.

	* nptl/pthreadP.h (ASSERT_PTHREAD_INTERNAL_SIZE): Add workarond for
	-Wmissing-braces on GCC 4.9.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119



Signed-off-by: default avatarAdhemerval Zanella <adhemerval.zanella@linaro.org>
parent 8beba15d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment