git: 075fa5a9a8a3 - main - libc/gen/getgrent.c: plug warnings about write-only variables

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Mon, 29 Nov 2021 15:43:01 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=075fa5a9a8a3a140541ef07142ed5b721264c0e9

commit 075fa5a9a8a3a140541ef07142ed5b721264c0e9
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-11-28 02:46:56 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
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;