From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 6F7501F8C8 for ; Thu, 16 Sep 2021 08:29:13 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 764DE3857815 for ; Thu, 16 Sep 2021 08:29:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 764DE3857815 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1631780952; bh=9VkO/FA26taprk1xff0KhsHRvXA8D0+yYYAd6HjCL2U=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ydtsDSgqX1A4UgE3Vt3RHIEg7UB8tIjl1FSvOijQ6Cdy28hi8UdU0ZATnTaXgsF6I PPdJHvVXZVQGFUpBP2uadSqMVblFlhaZHUBdUClhTuS/uDcxSCT40t+KV3rNDITf4v IIrNnGL2WxZ5LUlQvnfIE/471mrC2wHQeh35yQ7s= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id DECCA3858D3C for ; Thu, 16 Sep 2021 08:28:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DECCA3858D3C Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-439-C7YFz8Y_NfakRq77eCUICw-1; Thu, 16 Sep 2021 04:28:48 -0400 X-MC-Unique: C7YFz8Y_NfakRq77eCUICw-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4E32F801B3D; Thu, 16 Sep 2021 08:28:47 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4305D69FC8; Thu, 16 Sep 2021 08:28:46 +0000 (UTC) To: Aurelien Jarno Subject: Re: [PATCH v2] posix: Fix attribute access mode on getcwd [BZ #27476] References: <20210910183822.1458644-1-aurelien@aurel32.net> Date: Thu, 16 Sep 2021 10:28:44 +0200 In-Reply-To: <20210910183822.1458644-1-aurelien@aurel32.net> (Aurelien Jarno's message of "Fri, 10 Sep 2021 20:38:22 +0200") Message-ID: <87lf3worer.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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: , From: Florian Weimer via Libc-alpha Reply-To: Florian Weimer Cc: libc-alpha@sourceware.org Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" * Aurelien Jarno: > There is a GNU extension that allows to call getcwd(NULL, >0). It is > described in the documentation, but also directly in the unistd.h > header, just above the declaration. > > Therefore the attribute access mode added in commit 06febd8c6705 > is not correct. Drop it. > --- > posix/bits/unistd.h | 5 ++--- > posix/unistd.h | 3 +-- > 2 files changed, 3 insertions(+), 5 deletions(-) > > Note: I am aware of BZ #26545, however while it is being discussed, the > bug is still there, so I don't think we should block on a decision to > fix it. > > diff --git a/posix/bits/unistd.h b/posix/bits/unistd.h > index f0831386c7..622adeb2b2 100644 > --- a/posix/bits/unistd.h > +++ b/posix/bits/unistd.h > @@ -199,10 +199,9 @@ __NTH (readlinkat (int __fd, const char *__restrict __path, > #endif > > extern char *__getcwd_chk (char *__buf, size_t __size, size_t __buflen) > - __THROW __wur __attr_access ((__write_only__, 1, 2)); > + __THROW __wur; > extern char *__REDIRECT_NTH (__getcwd_alias, > - (char *__buf, size_t __size), getcwd) > - __wur __attr_access ((__write_only__, 1, 2)); > + (char *__buf, size_t __size), getcwd) __wur; > extern char *__REDIRECT_NTH (__getcwd_chk_warn, > (char *__buf, size_t __size, size_t __buflen), > __getcwd_chk) > diff --git a/posix/unistd.h b/posix/unistd.h > index 3dca65732f..8224c5fbc9 100644 > --- a/posix/unistd.h > +++ b/posix/unistd.h > @@ -528,8 +528,7 @@ extern int fchdir (int __fd) __THROW __wur; > an array is allocated with `malloc'; the array is SIZE > bytes long, unless SIZE == 0, in which case it is as > big as necessary. */ > -extern char *getcwd (char *__buf, size_t __size) __THROW __wur > - __attr_access ((__write_only__, 1, 2)); > +extern char *getcwd (char *__buf, size_t __size) __THROW __wur; > > #ifdef __USE_GNU > /* Return a malloc'd string containing the current directory name. This looks okay to me, thanks. Reviewed-by: Florian Weimer Florian