On 5/3/23 17:24, Bjarni Ingi Gislason wrote:

File "/etc/os-release" shows

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"

Why did 'configure' decide to replace dirfd? Please look into config.log for that. As things stand, it's likely that groff doesn't act correctly on your platform.

That being said, I see a path through lib/dirfd.c where dirfd's arg is ignored. GCC could be pacified by the attached patch, though I'm a bit loath to install this as I would like to get to the bottom of the real problem first.
From 4e865b47926fb349994f9161c360b31f5bce1409 Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Wed, 3 May 2023 18:16:13 -0700
Subject: [PATCH] dirfd: pacify gcc on Debian bookworm

Problem reported by Bjarni Ingi Gislason in:
https://lists.gnu.org/r/bug-gnulib/2023-05/msg00023.html
* lib/dirfd.c (dirfd): Mark parameter as possibly unused, which
can happen if !GNULIB_defined_DIR && !defined DIR_FD_MEMBER_NAME
&& !defined __KLIBC__.
---
 ChangeLog   | 9 +++++++++
 lib/dirfd.c | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index ac0153693e..52d6e4dad4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-05-03  Paul Eggert  <egg...@cs.ucla.edu>
+
+	dirfd: pacify gcc on Debian bookworm
+	Problem reported by Bjarni Ingi Gislason in:
+	https://lists.gnu.org/r/bug-gnulib/2023-05/msg00023.html
+	* lib/dirfd.c (dirfd): Mark parameter as possibly unused, which
+	can happen if !GNULIB_defined_DIR && !defined DIR_FD_MEMBER_NAME
+	&& !defined __KLIBC__.
+
 2023-05-03  Bruno Haible  <br...@clisp.org>
 
 	vasnprintf, vasnwprintf: Make '0' flag handling more ISO C compliant.
diff --git a/lib/dirfd.c b/lib/dirfd.c
index 75b2163c35..3ea1875904 100644
--- a/lib/dirfd.c
+++ b/lib/dirfd.c
@@ -80,7 +80,7 @@ _gl_unregister_dirp_fd (int fd)
 #endif
 
 int
-dirfd (DIR *dir_p)
+dirfd (_GL_UNUSED DIR *dir_p)
 {
 #if GNULIB_defined_DIR
   int fd = dir_p->fd_to_close;
-- 
2.40.1

Reply via email to