From nobody Mon Nov 29 15:43:01 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9C58418BC2F0; Mon, 29 Nov 2021 15:43:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J2qPK4kGjz4nLL; Mon, 29 Nov 2021 15:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 839012540A; Mon, 29 Nov 2021 15:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATFh1Bi065675; Mon, 29 Nov 2021 15:43:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATFh1R1065674; Mon, 29 Nov 2021 15:43:01 GMT (envelope-from git) Date: Mon, 29 Nov 2021 15:43:01 GMT Message-Id: <202111291543.1ATFh1R1065674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 075fa5a9a8a3 - main - libc/gen/getgrent.c: plug warnings about write-only variables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 075fa5a9a8a3a140541ef07142ed5b721264c0e9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638200581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GGEPlHP75d9/R5nnEC5wM1/K4nsWJutUQfZJeMtm98g=; b=t82lv0UarbO4HH772dJdX0o6UjE2oUUsp7hEJya0gsKJyowpa1TePNRWvp9O3ma61IDXZs hXamIlCjuOAGTOKNGP642Rjuav6YywHhdV2M0g3PdmV2giR0+YPw5yNp3E98DaLB9+Uu38 0IuBahIJpgxPLpMmIkaf7sNcGnaPcscqVF71x3GLseCsMLyJ56i389mlK9QbfSQDpnkZ47 259BcGnhQpOGxJfGUAlUaIKN4WM4YiVgeo4Nq2M1hEcEEHpm03PK10pg4r5P+1+qiZS9nC fGSRENhjVg/0uLchqonvqNVhAt7vKcLINOpVJJBmlKWzZlbJAis5Ouwa/k6mKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638200581; a=rsa-sha256; cv=none; b=f+uxYcu52ggmMj3gFYfAEy4zT5AlVn21X7+lxknRVfOtacap9utMwYXNB+acV7t6inTp+T 2wmIa0R9HKEHKwRMWD+hKOrcz5nokBQcWshG9MhRVvw2UDfe+MGLJXjCjfzYPTWfPhgBS/ p0yMDMOWViPivi+6i+V5MLAvs42sG+xWfwN6M4Ia7ADyymCjv73U1NzOQ3rk8Hec7gqsDc Q7id0udsSR8yQ4dfUEy9QjVzrTKXjFO6mKZaMv4eCXMAQcIBsAT8tZNJ5g3e6zpwypF8L6 Qjoso3At0d09KBjGMFjmsb6RjHGIqtDmBF8dzLMWUI6kWzLm9F6x/YvhFrwfLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=075fa5a9a8a3a140541ef07142ed5b721264c0e9 commit 075fa5a9a8a3a140541ef07142ed5b721264c0e9 Author: Konstantin Belousov AuthorDate: 2021-11-28 02:46:56 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-29 15:39:50 +0000 libc/gen/getgrent.c: plug warnings about write-only variables The variables clang13 complains about take the results of var_arg() calls. I decided to kept variables around, annotating their definitions with __unused, to keep clear expected types of the varargs. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libc/gen/getgrent.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c index 5832cb8c6799..3743518c8f58 100644 --- a/lib/libc/gen/getgrent.c +++ b/lib/libc/gen/getgrent.c @@ -210,12 +210,11 @@ static int grp_marshal_func(char *buffer, size_t *buffer_size, void *retval, va_list ap, void *cache_mdata) { - char *name; - gid_t gid; + char *name __unused; + gid_t gid __unused; struct group *grp; - char *orig_buf; - size_t orig_buf_size; - + char *orig_buf __unused; + size_t orig_buf_size __unused; struct group new_grp; size_t desired_size, size, mem_size; char *p, **mem; @@ -305,8 +304,8 @@ static int grp_unmarshal_func(char *buffer, size_t buffer_size, void *retval, va_list ap, void *cache_mdata) { - char *name; - gid_t gid; + char *name __unused; + gid_t gid __unused; struct group *grp; char *orig_buf; size_t orig_buf_size;