From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by sourceware.org (Postfix) with ESMTPS id 2182D3896822 for ; Tue, 27 Apr 2021 19:07:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2182D3896822 Received: by mail-qk1-x732.google.com with SMTP id q127so1938693qkb.1 for ; Tue, 27 Apr 2021 12:07:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qwp/Ki699MOGC4Ao94687ercYuvL8ja7O2dADGW58l0=; b=T2NxVN5fmpZClq9kuZndh2NHJ5uSqvnmZ9MYeQ+BjsCthZXg3DTSWy047VY9VBZ/87 ENApsZMAXlxpnnKz6uu3YpAPfyktyMg8bgshjjH/gbV2WMjkuSl8930bI4QS7vTXgHxA V9AqWko7wT7UrOxX4gwWnXznjvIVWrHDQvxfgEey7f7N60iKg4WdcTXa7z5ZqTRmdqFp P59Hh89E0d2RLDKdhtAv7l/nO1hpsryrt9W0g5BOOOIIiZXSkSc/wXLy8fMAImgSJN0Q XoIH+/HZSFHVv2Di2CcSQ9hdYZUmUNAf0/ZLbievdDkDi0ydcTWp3r8oOsp/gb7uub51 TFSg== X-Gm-Message-State: AOAM530F7G+MZO+6pHza7Eor8L4sSrWnCSOTdXe2F2U+QHaG8n+8HFKZ AXAa9ab8iVi+vKcTKKUvAQp8mI88OFA= X-Google-Smtp-Source: ABdhPJxR6w3aiHPc8aHSMALfrxfRQvzQMd+qO2eqhQv093+n+RwzRtrCBxi1+QT9c/+m4GA34S4ZYQ== X-Received: by 2002:a37:9c01:: with SMTP id f1mr12855394qke.109.1619550423410; Tue, 27 Apr 2021 12:07:03 -0700 (PDT) Received: from [192.168.0.41] (71-218-14-121.hlrn.qwest.net. [71.218.14.121]) by smtp.gmail.com with ESMTPSA id l71sm3416802qke.27.2021.04.27.12.07.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Apr 2021 12:07:03 -0700 (PDT) Subject: Re: [PATCH] add attribute none to pthread_setspecific (BZ #27714) To: Florian Weimer , Martin Sebor via Libc-alpha References: <2ec7fadb-cc15-a005-f708-d2adecc8cc39@gmail.com> <875z08qqy8.fsf@oldenburg.str.redhat.com> From: Martin Sebor Message-ID: Date: Tue, 27 Apr 2021 13:07:01 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <875z08qqy8.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 19:07:05 -0000 On 4/26/21 10:41 PM, Florian Weimer wrote: > * Martin Sebor via Libc-alpha: > >> diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h >> index 8e244a77cf..ac56be4d87 100644 >> --- a/misc/sys/cdefs.h >> +++ b/misc/sys/cdefs.h >> @@ -592,8 +592,14 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf >> array according to access mode, or at least one element when >> size-index is not provided: >> access (access-mode, [, ]) */ >> -#define __attr_access(x) __attribute__ ((__access__ x)) >> +# define __attr_access(x) __attribute__ ((__access__ x)) >> +# if __GNUC_PREREQ (11, 0) >> +# define __attr_access_none(pos) __attribute__ ((__access__ (__none__, pos))) >> +# endif >> #else >> # define __attr_access(x) >> +# define __attr_access_none(pos) >> +#endif > > I don't think this works because __attr_access_none is not defined for > GCC 10 due to the way the definitions are nested. I think you should > move the __GNUC_PREREQ (11, 0) check to the top level. You're right. I had inadvertently reverted the pthread.h changes so my testing didn't expose it. Too many patches in the same tree... I've committed a1561c3bbe with the missing definition (and retesting the macro). > > It might be consistent with fewer attribute access extensions to write > __attr_access_none ((__none__, 2)) instead of __attr_access_none (2). Repeating the "none" part doesn't seem in any way useful to me. It wouldn't reduce the number of macros, existing or new. Martin > > Thanks, > Florian >