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: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.5 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RDNS_DYNAMIC,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (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 B84FA1F8C6 for ; Tue, 14 Sep 2021 14:06:30 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EE980385842B for ; Tue, 14 Sep 2021 14:06:29 +0000 (GMT) Received: from hall.aurel32.net (hall.aurel32.net [IPv6:2001:bc8:30d7:100::1]) by sourceware.org (Postfix) with ESMTPS id A8EEC3858402 for ; Tue, 14 Sep 2021 14:06:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A8EEC3858402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=aurel32.net Authentication-Results: sourceware.org; spf=none smtp.mailfrom=aurel32.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=aurel32.net ; s=202004.hall; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Content-Transfer-Encoding:From:Reply-To: Subject:Content-ID:Content-Description:X-Debbugs-Cc; bh=6SC/29trQlBAeS/YMcX24/J9HLjEojwJRU6PX4xFfd0=; b=d2pQTWzozaarv8h9LAdSjt5YIp 9wdCwVKNPPP667x/55ek1MalrHao879StJbaE7kXeUnlMPWiIfxpMjV5aYVW9Qg+m7fueCYa4r1DS YKL5YoWm4tI3VARqJQk3EV5lbjO7IiitUYbhaDCN7p6+ud+D6YmrZbRX6Ji36h7xdLZq94uuXv4X9 VUVAhRRwuJxT8E/Eo2rZT/3g0vfOGTlIS4oYDJQv3NSwcVX0tp6HqVb8P0hmPC3zF/TpssUNPLOVB XmesaJ88IpNUiGhTvQfTJocKdq+ahW1XZ6VvlqBUb5ReOZg8LtSVq08oLfduGTJ4y+yNJ5YO1qiaq hIAZk8AA==; Received: from [2a01:e34:ec5d:a741:8a4c:7c4e:dc4c:1787] (helo=ohm.rr44.fr) by hall.aurel32.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mQ94d-00043Y-TM; Tue, 14 Sep 2021 16:06:11 +0200 Received: from aurel32 by ohm.rr44.fr with local (Exim 4.94.2) (envelope-from ) id 1mQ94d-009zzD-9Q; Tue, 14 Sep 2021 16:06:11 +0200 Date: Tue, 14 Sep 2021 16:06:11 +0200 From: Aurelien Jarno To: libc-alpha@sourceware.org Subject: Re: [PATCH v2] posix: Fix attribute access mode on getcwd [BZ #27476] Message-ID: Mail-Followup-To: libc-alpha@sourceware.org, Florian Weimer References: <20210910183822.1458644-1-aurelien@aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210910183822.1458644-1-aurelien@aurel32.net> User-Agent: Mutt/2.0.5 (2021-01-21) 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: , Cc: Florian Weimer Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" Any opinion about that patch? Florian maybe given you have reviewed v1? Thanks Aurelien On 2021-09-10 20:38, Aurelien Jarno wrote: > 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. > -- > 2.30.2 > > -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net