From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126301 invoked by alias); 19 Dec 2017 09:48:34 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 125896 invoked by uid 89); 19 Dec 2017 09:48:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: mx1.redhat.com Subject: Re: Disable -Wrestrict for two nptl/tst-attr3.c tests [committed] To: Joseph Myers , libc-alpha@sourceware.org References: From: Florian Weimer Message-ID: <7478a703-bde3-be9a-d0e4-7023ae76b910@redhat.com> Date: Tue, 19 Dec 2017 09:48:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2017-12/txt/msg00622.txt.bz2 On 12/18/2017 11:56 PM, Joseph Myers wrote: > 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, I think the restrict requirements extend to called functions as well, due to the way the execution of a block is defined in C11 (“an execution of [a block] B means that portion of the execution of the program that would correspond to the lifetime of an object with scalar type and automatic storage duration associated with B”). The proper fix seems to be to remove the restrict qualifier from the last argument of pthread_create, considering that the thread start routine argument lacks the restrict qualifier, too. Thanks, Florian