On 2/25/24 1:22 PM, Collin Funk wrote:
 > I've attached a patch that does this.

Assuming that there are no problems with that update this patch should
be applied too. I've added 'subdir-objects' to AM_INIT_AUTOMAKE to
silence these warnings:

lib/gnulib.mk:103: warning: source file 'malloc/scratch_buffer_grow_preserve.c' 
is in a subdirectory,
lib/gnulib.mk:103: but option 'subdir-objects' is disabled
lib/Makefile.am:14:   'lib/gnulib.mk' included from here
lib/gnulib.mk:103: warning: source file 
'malloc/scratch_buffer_set_array_size.c' is in a subdirectory,
lib/gnulib.mk:103: but option 'subdir-objects' is disabled
lib/Makefile.am:14:   'lib/gnulib.mk' included from here
lib/gnulib.mk:103: warning: source file 'glthread/lock.c' is in a subdirectory,
lib/gnulib.mk:103: but option 'subdir-objects' is disabled
lib/Makefile.am:14:   'lib/gnulib.mk' included from here
lib/gnulib.mk:103: warning: source file 'glthread/threadlib.c' is in a 
subdirectory,
lib/gnulib.mk:103: but option 'subdir-objects' is disabled
lib/Makefile.am:14:   'lib/gnulib.mk' included from here
lib/gnulib.mk:3223: warning: source file 'unictype/ctype_print.c' is in a 
subdirectory,
lib/gnulib.mk:3223: but option 'subdir-objects' is disabled
lib/Makefile.am:14:   'lib/gnulib.mk' included from here

Then changed calls to hash_delete to use hash_remove instead. The
first is marked for removal by this commit:

https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=342e7423fd65e96f83299494d69ddf03e171413e

There are also some warnings about obsolete Autoconf macros. I've left
the unchanged as I am unsure if they will break builds for older
versions. I am using version 2.71 if it matters.

Let me know if I missed anything.

Collin
From a571de61584f83e2f9e7315b67a7015714aed025 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Sun, 25 Feb 2024 13:42:28 -0800
Subject: [PATCH 2/2] build: Enable the 'subdir-objects' Automake option.

* configure.ac (AM_INIT_AUTOMAKE): Add 'subdir-objects'.
* src/safe.c (remove_cached_dirfd): Use hash_remove instead of the
deprecated hash_delete.
---
 configure.ac | 2 +-
 src/safe.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 970e6eb..0fb9c5e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,7 +33,7 @@ AM_CONDITIONAL([ENABLE_MERGE], [test "$enableval" != no])
 AM_CONDITIONAL([ALPHA_VERSION],
   [[echo "$PACKAGE_VERSION" | grep -- "-[0-9a-f][0-9a-f]*\\(-dirty\\)\\?$" >/dev/null]])
 
-AM_INIT_AUTOMAKE([1.11.2 -Wall gnu dist-bzip2 dist-xz color-tests parallel-tests])
+AM_INIT_AUTOMAKE([1.11.2 -Wall gnu dist-bzip2 dist-xz color-tests parallel-tests subdir-objects])
 AM_SILENT_RULES([yes])
 
 AC_CONFIG_HEADERS([config.h:config.hin])
diff --git a/src/safe.c b/src/safe.c
index f147b0e..e59614b 100644
--- a/src/safe.c
+++ b/src/safe.c
@@ -142,10 +142,10 @@ static void remove_cached_dirfd (struct cached_dirfd *entry)
 	list_entry (entry->children.next, struct cached_dirfd, children_link);
       list_del_init (&child->children_link);
       /* assert (list_empty (&child->children_link)); */
-      hash_delete (cached_dirfds, child);  /* noop when not hashed */
+      hash_remove (cached_dirfds, child);  /* noop when not hashed */
     }
   list_del (&entry->lru_link);
-  hash_delete (cached_dirfds, entry);  /* noop when not hashed */
+  hash_remove (cached_dirfds, entry);  /* noop when not hashed */
   close (entry->fd);
   free_cached_dirfd (entry);
 }
-- 
2.39.2

Reply via email to