]> git.ipfire.org Git - thirdparty/glibc.git/commit
Disable -Wrestrict for two nptl/tst-attr3.c tests.
authorJoseph Myers <joseph@codesourcery.com>
Mon, 18 Dec 2017 22:55:28 +0000 (22:55 +0000)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 22 Oct 2018 12:20:23 +0000 (14:20 +0200)
commit33f5de7a79b27b9dce30a46d6681974653a85004
tree866ce9202d8ee32bd9243357237a78c40195efb1
parent6ae2ca620a955f1e3465e58b5180c5a7fd596dd0
Disable -Wrestrict for two nptl/tst-attr3.c tests.

nptl/tst-attr3 fails to build with GCC mainline because of
(deliberate) aliasing between the second (attributes) and fourth
(argument to thread start routine) arguments to pthread_create.

Although both those arguments are restrict-qualified in POSIX,
pthread_create does not actually dereference its fourth argument; it's
an opaque pointer passed to the thread start routine.  Thus, the
aliasing is actually valid in this case, and it's deliberate in the
test.  So this patch makes the test disable -Wrestrict for the two
pthread_create calls in question.  (-Wrestrict was added in GCC 7,
hence the __GNUC_PREREQ conditions, but the particular warning in
question is new in GCC 8.)

Tested compilation with build-many-glibcs.py for aarch64-linux-gnu.

* nptl/tst-attr3.c: Include <libc-diag.h>.
(do_test) [__GNUC_PREREQ (7, 0)]: Ignore -Wrestrict for two tests.

(cherry picked from commit 40c4162df6766fb1e8ede875ca8df25d8075d3a5)
ChangeLog
nptl/tst-attr3.c