From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.6 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 5DAEB1F85E for ; Thu, 12 Jul 2018 19:26:54 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=OdTJ0+Tq9SBGt9Iz B7c1Uk4esWrFEkrXh7K9OIFMmVQH9hdsAk6da8n7nL4uCSwvpQuxWoVG5xHc7uxf BpTcIae1zs5SusrDoE2/C0olmZ9cJdKoaWTVihoJmwoATe4H6wBWn2wZB5krFjaf npJGcDizH0CNGQ1VT2JH431dXmQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=gliFJmhfU60/fI683997Jd kBRzA=; b=ITSIKYJvn+y3A1+vsERWKIQh0vX6s6+tJtP+evbKSrePEodsYYegJX 93o24Iq20v5cuv5DT1+RJ9VzFKyUc4u7rYG7I3h0UjUhOOVFVJzX5PJ1DXHa7mWZ sAvfriapwaSNJY4+PpT7HSDjIVuilum4D9nkSVda2I6fxuRK1/94w= Received: (qmail 10368 invoked by alias); 12 Jul 2018 19:26:52 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 10352 invoked by uid 89); 12 Jul 2018 19:26:51 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mx1.redhat.com Subject: Re: [PATCH v8 1/8] nptl: Add C11 threads thrd_* functions To: Adhemerval Zanella , libc-alpha@sourceware.org References: <1517591084-11347-1-git-send-email-adhemerval.zanella@linaro.org> <1517591084-11347-2-git-send-email-adhemerval.zanella@linaro.org> <8c257a2d-60b4-e12d-28a5-d7a4fc4408de@redhat.com> <837df3e1-dbcf-ecc4-55ab-e89d7c447bba@linaro.org> From: Florian Weimer Message-ID: <291f3ef9-0312-2f50-4c66-b3efda628cda@redhat.com> Date: Thu, 12 Jul 2018 21:26:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <837df3e1-dbcf-ecc4-55ab-e89d7c447bba@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 07/12/2018 09:19 PM, Adhemerval Zanella wrote: > Also on GCC BZ#53769 [1] Joseph wrote that check for __STDC_VERSION__ > and/or __STDC_NO_THREADS__ is not meaningful to documented incomplete > compiler support for language standard. This is at least for GCC > standpoint, not sure about other compilers. > > We could add a check like: > > #if (defined (__GNUC__) && !__GNUC_PREREQ (4.9)) > || (!defined (__cpluscplus) && __cplusplus < 201103L) > # define __STDC_NO_THREADS__ 1 > #endif > > [1]https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53769 I think your first patch was fine. The header exists after your change. We could polish the definition of thread_local in the header file with some conditionals, though, so that we fall back to __thread for GCC prior to 4.9. The definition of the thread_local macro will be non-confirming, but that's what you get for using a non-conforming implementation. (If the C compiler is not known to be C, we need to use _Thread_local, even though __thread probably covers more old implementations out there.) Thanks, Florian