From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7830 invoked by alias); 22 Oct 2018 13:02:29 -0000 Mailing-List: contact libc-stable-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: List-Archive: Sender: libc-stable-owner@sourceware.org Received: (qmail 7789 invoked by uid 89); 22 Oct 2018 13:02:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.1 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Oct 2018 13:02:23 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9D58D30020C8 for ; Mon, 22 Oct 2018 13:02:22 +0000 (UTC) Received: from oldenburg.str.redhat.com (dhcp-192-212.str.redhat.com [10.33.192.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id 692D76D78A for ; Mon, 22 Oct 2018 13:02:22 +0000 (UTC) Received: by oldenburg.str.redhat.com (Postfix, from userid 1000) id D43074399457D; Mon, 22 Oct 2018 15:02:21 +0200 (CEST) Date: Mon, 01 Jan 2018 00:00:00 -0000 To: libc-stable@sourceware.org Subject: [2.26 COMMITTED] Disable -Wrestrict for two nptl/tst-attr3.c tests. User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20181022130221.D43074399457D@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 22 Oct 2018 13:02:22 +0000 (UTC) X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00014.txt.bz2 From: Joseph Myers 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 . (do_test) [__GNUC_PREREQ (7, 0)]: Ignore -Wrestrict for two tests. (cherry picked from commit 40c4162df6766fb1e8ede875ca8df25d8075d3a5) 2017-12-18 Joseph Myers * nptl/tst-attr3.c: Include . (do_test) [__GNUC_PREREQ (7, 0)]: Ignore -Wrestrict for two tests. 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");