diff --git a/ChangeLog b/ChangeLog index d4223dbb9e..c6dfc5e677 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-12-18 Joseph Myers + + * nptl/tst-attr3.c: Include . + (do_test) [__GNUC_PREREQ (7, 0)]: Ignore -Wrestrict for two tests. + 2017-11-14 Joseph Myers * string/bug-strncat1.c: Include . diff --git a/nptl/tst-attr3.c b/nptl/tst-attr3.c index bc23386daf..420a7dba8b 100644 --- a/nptl/tst-attr3.c +++ b/nptl/tst-attr3.c @@ -26,6 +26,7 @@ #include #include +#include static void * tf (void *arg) @@ -362,7 +363,16 @@ do_test (void) result = 1; } + DIAG_PUSH_NEEDS_COMMENT; +#if __GNUC_PREREQ (7, 0) + /* GCC 8 warns about aliasing of the restrict-qualified arguments + passed &a. Since pthread_create does not dereference its fourth + argument, this aliasing, which is deliberate in this test, cannot + in fact cause problems. */ + DIAG_IGNORE_NEEDS_COMMENT (8, "-Wrestrict"); +#endif err = pthread_create (&th, &a, tf, &a); + DIAG_POP_NEEDS_COMMENT; if (err) { error (0, err, "pthread_create #2 failed"); @@ -388,7 +398,16 @@ do_test (void) result = 1; } + DIAG_PUSH_NEEDS_COMMENT; +#if __GNUC_PREREQ (7, 0) + /* GCC 8 warns about aliasing of the restrict-qualified arguments + passed &a. Since pthread_create does not dereference its fourth + argument, this aliasing, which is deliberate in this test, cannot + in fact cause problems. */ + DIAG_IGNORE_NEEDS_COMMENT (8, "-Wrestrict"); +#endif err = pthread_create (&th, &a, tf, &a); + DIAG_POP_NEEDS_COMMENT; if (err) { error (0, err, "pthread_create #3 failed");