Subject: bug#77476: closed (Re: bug#77476: [PATCH] Rename various hash functions to avoid clashing with GnuTLS.)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 20 Apr 2025 05:33:02 +0000

Your bug report

#77476: [PATCH] Rename various hash functions to avoid clashing with GnuTLS.

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
77476: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77476
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#77476: [PATCH] Rename various hash functions to avoid clashing with GnuTLS.
From: Paul Eggert <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sat, 19 Apr 2025 22:32:44 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

On 2025-04-19 06:50, Eli Zaretskii wrote:
> Paul, could you please chime in, since these are Gnulib
> functions we're talking about.

GnuTLS incorrectly exports some Gnulib functions to the outside world, 
and this breaks programs that use these function names for their own 
purposes.

Gnulib has a way to fix this: its lib-symbol-visibility module. GnuTLS 
should use this (or do the equivalent by hand), but doesn't. I suppose 
GnuTLS has other visibility problems like this, and they should all be 
fixed. I filed a bug report with the GnuTLS folks about this; see 
<https://gitlab.com/gnutls/gnutls/-/issues/1703>.

Possibly this problem even affects normal (i.e., dynamically linked) 
Emacs on some platforms. As Greg says, the semantics of name clashes is 
not portable, and I am particularly worried about what would happen if 
dynamically loaded modules refer to the clashing names on some random 
platform. As we can't expect GnuTLS to fix their bug soon, or for all 
our users to update to the fixed GnuTLS version soon, we should change 
the Emacs names to avoid the clash in the meantime.

It's just two names so I did that, by installing the attached patch on 
master. I changed "hash_string" to "hash_char_array" which is a more 
accurate name as the argument is not a C string, and I changed 
"hash_lookup" to "hash_find" which is a bit shorter. I also changed two 
other names to match.

I doubt whether this patch is urgent enough to backport to the emacs-30 
branch. Hardly anybody links statically; the GnuTLS build procedure even 
warns against doing static linking (due to other static-linking problems 
that Emacs does not run into). And most likely, dynamically-linked 
modules won't use the clashing symbols.

Marking the bug as done.
From c8eed90eb4d0583dc3463edfad176b9d3f98d11f Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Sat, 19 Apr 2025 18:44:52 -0700
Subject: [PATCH] Avoid name clashes with static GnuTLS
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Work around a bug in GnuTLS 3.7.11 and earlier: when built
statically, its mistakenly exports symbols hash_lookup and
hash_string, which collide with Emacs symbols of the same name,
preventing temacs from linking statically.  Problem reported by
Greg A. Woods (Bug#77476).

Because GnuTLS never uses hash_lookup or hash_string this issue
ordinarily doesn’t seem to prevent temacs from linking to GnuTLS
on GNU/Linux, as it’s linked dynamically and the dynamic linker
never needs to resolve references to either symbol.  However, I
suppose a clash or bug could occur even with dynamic linking if
Emacs later loads a module that uses either symbol.

Although GnuTLS should be fixed, Emacs should link statically to
current and older GnuTLS versions in the meantime, and it should
avoid potential problems with dynamic linking.  Renaming the two
clashing names is an easy way to do this.  For consistency with
the new name for hash_lookup, also rename hash_lookup_with_hash
and hash_lookup_get_hash.

* src/fns.c (hash_find_with_hash): Rename from hash_lookup_with_hash.
(hash_find): Rename from hash_lookup.
(hash_find_get_hash): Rename from hash_lookup_get_hash.
(hash_char_array): Rename from hash_string.
All uses changed.
---
 src/bytecode.c     |  2 +-
 src/category.c     |  2 +-
 src/ccl.c          |  4 ++--
 src/charset.c      |  3 +--
 src/charset.h      |  2 +-
 src/coding.h       |  2 +-
 src/composite.c    |  2 +-
 src/emacs-module.c |  6 +++---
 src/fns.c          | 28 ++++++++++++++--------------
 src/image.c        |  6 +++---
 src/json.c         |  2 +-
 src/lisp.h         |  8 ++++----
 src/lread.c        | 16 ++++++++--------
 src/macfont.m      |  4 ++--
 src/minibuf.c      |  2 +-
 15 files changed, 44 insertions(+), 45 deletions(-)

diff --git a/src/bytecode.c b/src/bytecode.c
index ecea0c6df36..4475d4a0b30 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1763,7 +1763,7 @@ #define DEFINE(name, value) [name] = &&insn_ ## name,
               }
             else
 	      {
-		ptrdiff_t i = hash_lookup (h, v1);
+		ptrdiff_t i = hash_find (h, v1);
 		if (i >= 0)
 		  {
 		    op = XFIXNUM (HASH_VALUE (h, i));
diff --git a/src/category.c b/src/category.c
index 297ba94c73d..f65c7d94331 100644
--- a/src/category.c
+++ b/src/category.c
@@ -54,7 +54,7 @@ hash_get_category_set (Lisp_Object table, Lisp_Object category_set)
        make_hash_table (&hashtest_equal, DEFAULT_HASH_SIZE, Weak_None));
   struct Lisp_Hash_Table *h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]);
   hash_hash_t hash;
-  ptrdiff_t i = hash_lookup_get_hash (h, category_set, &hash);
+  ptrdiff_t i = hash_find_get_hash (h, category_set, &hash);
   if (i >= 0)
     return HASH_KEY (h, i);
   hash_put (h, category_set, Qnil, hash);
diff --git a/src/ccl.c b/src/ccl.c
index a45fe0439c4..36094ca627e 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1375,7 +1375,7 @@ #define EXCMD (field1 >> 6)
 
 		eop = (FIXNUM_OVERFLOW_P (reg[RRR])
 		       ? -1
-		       : hash_lookup (h, make_fixnum (reg[RRR])));
+		       : hash_find (h, make_fixnum (reg[RRR])));
 		if (eop >= 0)
 		  {
 		    Lisp_Object opl;
@@ -1404,7 +1404,7 @@ #define EXCMD (field1 >> 6)
 
 		eop = (FIXNUM_OVERFLOW_P (i)
 		       ? -1
-		       : hash_lookup (h, make_fixnum (i)));
+		       : hash_find (h, make_fixnum (i)));
 		if (eop >= 0)
 		  {
 		    Lisp_Object opl;
diff --git a/src/charset.c b/src/charset.c
index 797dfde276f..3264d75f92e 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1112,8 +1112,7 @@ DEFUN ("define-charset-internal", Fdefine_charset_internal,
 
   hash_hash_t hash_code;
   ptrdiff_t hash_index
-    = hash_lookup_get_hash (hash_table, args[charset_arg_name],
-			    &hash_code);
+    = hash_find_get_hash (hash_table, args[charset_arg_name], &hash_code);
   if (hash_index >= 0)
     {
       new_definition_p = false;
diff --git a/src/charset.h b/src/charset.h
index 0217ec321ff..f76e9100892 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -285,7 +285,7 @@ #define CHARSET_SYMBOL_ID(symbol)	\
 /* Return an index to Vcharset_hash_table of the charset whose symbol
    is SYMBOL.  */
 #define CHARSET_SYMBOL_HASH_INDEX(symbol)	\
-  hash_lookup (XHASH_TABLE (Vcharset_hash_table), symbol)
+  hash_find (XHASH_TABLE (Vcharset_hash_table), symbol)
 
 /* Return the attribute vector of CHARSET.  */
 #define CHARSET_ATTRIBUTES(charset) (charset)->attributes
diff --git a/src/coding.h b/src/coding.h
index b72ffde3c55..2d538ba69d3 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -193,7 +193,7 @@ #define CODING_SYSTEM_SPEC(coding_system_symbol)	\
 /* Return the ID of CODING_SYSTEM_SYMBOL.  */
 
 #define CODING_SYSTEM_ID(coding_system_symbol)			\
-  hash_lookup (XHASH_TABLE (Vcoding_system_hash_table),		\
+  hash_find (XHASH_TABLE (Vcoding_system_hash_table),		\
 	       coding_system_symbol)
 
 /* Return true if CODING_SYSTEM_SYMBOL is a coding system.  */
diff --git a/src/composite.c b/src/composite.c
index 2ef72a33d2e..b6c5b61a6a9 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -241,7 +241,7 @@ get_composition_id (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t nchars,
     goto invalid_composition;
 
   hash_hash_t hash_code;
-  hash_index = hash_lookup_get_hash (hash_table, key, &hash_code);
+  hash_index = hash_find_get_hash (hash_table, key, &hash_code);
   if (hash_index >= 0)
     {
       /* We have already registered the same composition.  Change PROP
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 7797b04e026..2feca41e7ae 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -413,7 +413,7 @@ XMODULE_GLOBAL_REFERENCE (Lisp_Object o)
 module_global_reference_p (emacs_value v, ptrdiff_t *n)
 {
   struct Lisp_Hash_Table *h = XHASH_TABLE (Vmodule_refs_hash);
-  /* Note that we can't use `hash_lookup' because V might be a local
+  /* Note that we can't use `hash_find' because V might be a local
      reference that's identical to some global reference.  */
   DOHASH (h, k, val)
     if (&XMODULE_GLOBAL_REFERENCE (val)->value == v)
@@ -431,7 +431,7 @@ module_make_global_ref (emacs_env *env, emacs_value value)
   struct Lisp_Hash_Table *h = XHASH_TABLE (Vmodule_refs_hash);
   Lisp_Object new_obj = value_to_lisp (value);
   hash_hash_t hashcode;
-  ptrdiff_t i = hash_lookup_get_hash (h, new_obj, &hashcode);
+  ptrdiff_t i = hash_find_get_hash (h, new_obj, &hashcode);
 
   /* Note: This approach requires the garbage collector to never move
      objects.  */
@@ -470,7 +470,7 @@ module_free_global_ref (emacs_env *env, emacs_value global_value)
   MODULE_FUNCTION_BEGIN ();
   struct Lisp_Hash_Table *h = XHASH_TABLE (Vmodule_refs_hash);
   Lisp_Object obj = value_to_lisp (global_value);
-  ptrdiff_t i = hash_lookup (h, obj);
+  ptrdiff_t i = hash_find (h, obj);
 
   if (module_assertions)
     {
diff --git a/src/fns.c b/src/fns.c
index e9643627bfa..52f667a72a5 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2815,8 +2815,8 @@ equal_no_quit (Lisp_Object o1, Lisp_Object o2)
   return internal_equal (o1, o2, EQUAL_NO_QUIT, 0, Qnil);
 }
 
-static ptrdiff_t hash_lookup_with_hash (struct Lisp_Hash_Table *h,
-					Lisp_Object key, hash_hash_t hash);
+static ptrdiff_t hash_find_with_hash (struct Lisp_Hash_Table *h,
+				      Lisp_Object key, hash_hash_t hash);

 /* Return true if O1 and O2 are equal.  EQUAL_KIND specifies what kind
@@ -2848,7 +2848,7 @@ internal_equal_1 (Lisp_Object o1, Lisp_Object o2, enum equal_kind equal_kind,
 	  {
 	    struct Lisp_Hash_Table *h = XHASH_TABLE (*ht);
 	    hash_hash_t hash = hash_from_key (h, o1);
-	    ptrdiff_t i = hash_lookup_with_hash (h, o1, hash);
+	    ptrdiff_t i = hash_find_with_hash (h, o1, hash);
 	    if (i >= 0)
 	      { /* `o1' was seen already.  */
 		Lisp_Object o2s = HASH_VALUE (h, i);
@@ -5031,8 +5031,8 @@ hash_table_thaw (Lisp_Object hash_table)
 /* Look up KEY with hash HASH in table H.
    Return entry index or -1 if none.  */
 static ptrdiff_t
-hash_lookup_with_hash (struct Lisp_Hash_Table *h,
-		       Lisp_Object key, hash_hash_t hash)
+hash_find_with_hash (struct Lisp_Hash_Table *h,
+		     Lisp_Object key, hash_hash_t hash)
 {
   ptrdiff_t start_of_bucket = hash_index_index (h, hash);
   for (ptrdiff_t i = HASH_INDEX (h, start_of_bucket);
@@ -5048,20 +5048,20 @@ hash_lookup_with_hash (struct Lisp_Hash_Table *h,
 
 /* Look up KEY in table H.  Return entry index or -1 if none.  */
 ptrdiff_t
-hash_lookup (struct Lisp_Hash_Table *h, Lisp_Object key)
+hash_find (struct Lisp_Hash_Table *h, Lisp_Object key)
 {
-  return hash_lookup_with_hash (h, key, hash_from_key (h, key));
+  return hash_find_with_hash (h, key, hash_from_key (h, key));
 }
 
 /* Look up KEY in hash table H.  Return its hash value in *PHASH.
    Value is the index of the entry in H matching KEY, or -1 if not found.  */
 ptrdiff_t
-hash_lookup_get_hash (struct Lisp_Hash_Table *h, Lisp_Object key,
-		      hash_hash_t *phash)
+hash_find_get_hash (struct Lisp_Hash_Table *h, Lisp_Object key,
+		    hash_hash_t *phash)
 {
   EMACS_UINT hash = hash_from_key (h, key);
   *phash = hash;
-  return hash_lookup_with_hash (h, key, hash);
+  return hash_find_with_hash (h, key, hash);
 }
 
 static void
@@ -5286,7 +5286,7 @@ #define SXHASH_MAX_LEN   7
    can be any EMACS_UINT value.  */
 
 EMACS_UINT
-hash_string (char const *ptr, ptrdiff_t len)
+hash_char_array (char const *ptr, ptrdiff_t len)
 {
   char const *p   = ptr;
   char const *end = ptr + len;
@@ -5459,7 +5459,7 @@ sxhash_obj (Lisp_Object obj, int depth)
       return XHASH (obj);
 
     case Lisp_String:
-      return hash_string (SSDATA (obj), SBYTES (obj));
+      return hash_char_array (SSDATA (obj), SBYTES (obj));
 
     case Lisp_Vectorlike:
       {
@@ -5861,7 +5861,7 @@ DEFUN ("gethash", Fgethash, Sgethash, 2, 3, 0,
   (Lisp_Object key, Lisp_Object table, Lisp_Object dflt)
 {
   struct Lisp_Hash_Table *h = check_hash_table (table);
-  ptrdiff_t i = hash_lookup (h, key);
+  ptrdiff_t i = hash_find (h, key);
   return i >= 0 ? HASH_VALUE (h, i) : dflt;
 }
 
@@ -5876,7 +5876,7 @@ DEFUN ("puthash", Fputhash, Sputhash, 3, 3, 0,
   check_mutable_hash_table (table, h);
 
   EMACS_UINT hash = hash_from_key (h, key);
-  ptrdiff_t i = hash_lookup_with_hash (h, key, hash);
+  ptrdiff_t i = hash_find_with_hash (h, key, hash);
   if (i >= 0)
     set_hash_value_slot (h, i, value);
   else
diff --git a/src/image.c b/src/image.c
index 65d8db24adc..1d3faecf507 100644
--- a/src/image.c
+++ b/src/image.c
@@ -5552,7 +5552,7 @@ xpm_free_color_cache (void)
 static int
 xpm_color_bucket (char *color_name)
 {
-  EMACS_UINT hash = hash_string (color_name, strlen (color_name));
+  EMACS_UINT hash = hash_char_array (color_name, strlen (color_name));
   return hash % XPM_COLOR_CACHE_BUCKETS;
 }
 
@@ -6238,7 +6238,7 @@ xpm_put_color_table_h (Lisp_Object color_table,
   Lisp_Object chars = make_unibyte_string (chars_start, chars_len);
 
   hash_hash_t hash_code;
-  hash_lookup_get_hash (table, chars, &hash_code);
+  hash_find_get_hash (table, chars, &hash_code);
   hash_put (table, chars, color, hash_code);
 }
 
@@ -6249,7 +6249,7 @@ xpm_get_color_table_h (Lisp_Object color_table,
 {
   struct Lisp_Hash_Table *table = XHASH_TABLE (color_table);
   ptrdiff_t i =
-    hash_lookup (table, make_unibyte_string (chars_start, chars_len));
+    hash_find (table, make_unibyte_string (chars_start, chars_len));
 
   return i >= 0 ? HASH_VALUE (table, i) : Qnil;
 }
diff --git a/src/json.c b/src/json.c
index 5795c582ce0..beac242b709 100644
--- a/src/json.c
+++ b/src/json.c
@@ -1571,7 +1571,7 @@ json_parse_object (struct json_parser *parser)
 	    hash_hash_t hash;
 	    Lisp_Object key = parser->object_workspace[i];
 	    Lisp_Object value = parser->object_workspace[i + 1];
-	    ptrdiff_t i = hash_lookup_get_hash (h, key, &hash);
+	    ptrdiff_t i = hash_find_get_hash (h, key, &hash);
 	    if (i < 0)
 	      hash_put (h, key, value, hash);
 	    else
diff --git a/src/lisp.h b/src/lisp.h
index bca58b9c12d..c2450440ab9 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4261,14 +4261,14 @@ #define CONS_TO_INTEGER(cons, type, var)				\
 extern bool sweep_weak_table (struct Lisp_Hash_Table *, bool);
 extern void hexbuf_digest (char *, void const *, int);
 extern char *extract_data_from_object (Lisp_Object, ptrdiff_t *, ptrdiff_t *);
-EMACS_UINT hash_string (char const *, ptrdiff_t);
+EMACS_UINT hash_char_array (char const *, ptrdiff_t);
 EMACS_UINT sxhash (Lisp_Object);
 Lisp_Object make_hash_table (const struct hash_table_test *, EMACS_INT,
                              hash_table_weakness_t);
 Lisp_Object hash_table_weakness_symbol (hash_table_weakness_t weak);
-ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object);
-ptrdiff_t hash_lookup_get_hash (struct Lisp_Hash_Table *h, Lisp_Object key,
-				hash_hash_t *phash);
+ptrdiff_t hash_find (struct Lisp_Hash_Table *, Lisp_Object);
+ptrdiff_t hash_find_get_hash (struct Lisp_Hash_Table *h, Lisp_Object key,
+			      hash_hash_t *phash);
 ptrdiff_t hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object,
 		    hash_hash_t);
 void hash_remove_from_table (struct Lisp_Hash_Table *, Lisp_Object);
diff --git a/src/lread.c b/src/lread.c
index d39330bd0eb..5c8bbe7da9f 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4266,7 +4266,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
 			  = XHASH_TABLE (read_objects_map);
 			Lisp_Object number = make_fixnum (n);
 			hash_hash_t hash;
-			ptrdiff_t i = hash_lookup_get_hash (h, number, &hash);
+			ptrdiff_t i = hash_find_get_hash (h, number, &hash);
 			if (i >= 0)
 			  /* Not normal, but input could be malformed.  */
 			  set_hash_value_slot (h, i, placeholder);
@@ -4284,7 +4284,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
 			/* #N# -- reference to numbered object */
 			struct Lisp_Hash_Table *h
 			  = XHASH_TABLE (read_objects_map);
-			ptrdiff_t i = hash_lookup (h, make_fixnum (n));
+			ptrdiff_t i = hash_find (h, make_fixnum (n));
 			if (i < 0)
 			  INVALID_SYNTAX_WITH_BUFFER ();
 			obj = HASH_VALUE (h, i);
@@ -4579,7 +4579,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
 		struct Lisp_Hash_Table *h2
 		  = XHASH_TABLE (read_objects_completed);
 		hash_hash_t hash;
-		ptrdiff_t i = hash_lookup_get_hash (h2, placeholder, &hash);
+		ptrdiff_t i = hash_find_get_hash (h2, placeholder, &hash);
 		eassert (i < 0);
 		hash_put (h2, placeholder, Qnil, hash);
 		obj = placeholder;
@@ -4594,7 +4594,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
 		    struct Lisp_Hash_Table *h2
 		      = XHASH_TABLE (read_objects_completed);
 		    hash_hash_t hash;
-		    ptrdiff_t i = hash_lookup_get_hash (h2, obj, &hash);
+		    ptrdiff_t i = hash_find_get_hash (h2, obj, &hash);
 		    eassert (i < 0);
 		    hash_put (h2, obj, Qnil, hash);
 		  }
@@ -4606,8 +4606,8 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
 		/* ...and #n# will use the real value from now on.  */
 		struct Lisp_Hash_Table *h = XHASH_TABLE (read_objects_map);
 		hash_hash_t hash;
-		ptrdiff_t i = hash_lookup_get_hash (h, e->u.numbered.number,
-						    &hash);
+		ptrdiff_t i = hash_find_get_hash (h, e->u.numbered.number,
+						  &hash);
 		eassert (i >= 0);
 		set_hash_value_slot (h, i, obj);
 	      }
@@ -4661,7 +4661,7 @@ substitute_object_recurse (struct subst *subst, Lisp_Object subtree)
      by #n=, which means that we can find it as a value in
      COMPLETED.  */
   if (EQ (subst->completed, Qt)
-      || hash_lookup (XHASH_TABLE (subst->completed), subtree) >= 0)
+      || hash_find (XHASH_TABLE (subst->completed), subtree) >= 0)
     subst->seen = Fcons (subtree, subst->seen);
 
   /* Recurse according to subtree's type.
@@ -5173,7 +5173,7 @@ DEFUN ("unintern", Funintern, Sunintern, 2, 2, 0,
 static ptrdiff_t
 obarray_index (struct Lisp_Obarray *oa, const char *str, ptrdiff_t size_byte)
 {
-  EMACS_UINT hash = hash_string (str, size_byte);
+  EMACS_UINT hash = hash_char_array (str, size_byte);
   return knuth_hash (reduce_emacs_uint_to_hash_hash (hash), oa->size_bits);
 }
 
diff --git a/src/macfont.m b/src/macfont.m
index 4ff720c5dd2..2a0b9aa2554 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -1018,7 +1018,7 @@ static void mac_font_get_glyphs_for_variants (CFDataRef, UTF32Char,
   if (HASH_TABLE_P (macfont_family_cache))
     {
       struct Lisp_Hash_Table *h = XHASH_TABLE (macfont_family_cache);
-      ptrdiff_t i = hash_lookup (h, symbol);
+      ptrdiff_t i = hash_find (h, symbol);
 
       if (i >= 0)
 	{
@@ -1045,7 +1045,7 @@ static void mac_font_get_glyphs_for_variants (CFDataRef, UTF32Char,
 
   h = XHASH_TABLE (macfont_family_cache);
   hash_hash_t hash;
-  i = hash_lookup_get_hash (h, symbol, &hash);
+  i = hash_find_get_hash (h, symbol, &hash);
   value = string ? make_mint_ptr ((void *) CFRetain (string)) : Qnil;
   if (i >= 0)
     {
diff --git a/src/minibuf.c b/src/minibuf.c
index 28ec780b24e..6d96160a851 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -2103,7 +2103,7 @@ DEFUN ("test-completion", Ftest_completion, Stest_completion, 2, 3, 0,
   else if (HASH_TABLE_P (collection))
     {
       struct Lisp_Hash_Table *h = XHASH_TABLE (collection);
-      ptrdiff_t i = hash_lookup (h, string);
+      ptrdiff_t i = hash_find (h, string);
       if (i >= 0)
         {
           tem = HASH_KEY (h, i);
-- 
2.48.1

Subject: [PATCH] Rename various hash functions to avoid clashing with GnuTLS.
From: "Greg A. Woods" <[email-masked]>
To: [email-masked]
Date: Wed, 02 Apr 2025 20:46:03 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Rename various hash functions in src/fns.c to facilitate static-linking
with GnuTLS which includes clashing hash functions from its "gl"
subdirectory.

* src/fns.c: et al (hash_string, hash_lookup, hash_lookup_get_hash,
  hash_put, hash_remove_from_table): Rename with a leading "lisp_" prefix.
---
 src/bytecode.c     |  2 +-
 src/category.c     |  4 ++--
 src/ccl.c          |  4 ++--
 src/charset.c      |  4 ++--
 src/charset.h      |  2 +-
 src/coding.h       |  4 ++--
 src/composite.c    |  8 ++++----
 src/emacs-module.c |  8 ++++----
 src/fns.c          | 24 ++++++++++++------------
 src/image.c        |  8 ++++----
 src/json.c         |  4 ++--
 src/lisp.h         | 14 +++++++-------
 src/lread.c        | 20 ++++++++++----------
 src/minibuf.c      |  2 +-
 14 files changed, 54 insertions(+), 54 deletions(-)

diff --git a/src/bytecode.c b/src/bytecode.c
index ecea0c6df36..9d4f9de3eb4 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1763,7 +1763,7 @@ #define DEFINE(name, value) [name] = &&insn_ ## name,
               }
             else
 	      {
-		ptrdiff_t i = hash_lookup (h, v1);
+		ptrdiff_t i = lisp_hash_lookup (h, v1);
 		if (i >= 0)
 		  {
 		    op = XFIXNUM (HASH_VALUE (h, i));
diff --git a/src/category.c b/src/category.c
index 297ba94c73d..9909ba5701c 100644
--- a/src/category.c
+++ b/src/category.c
@@ -54,10 +54,10 @@ hash_get_category_set (Lisp_Object table, Lisp_Object category_set)
        make_hash_table (&hashtest_equal, DEFAULT_HASH_SIZE, Weak_None));
   struct Lisp_Hash_Table *h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]);
   hash_hash_t hash;
-  ptrdiff_t i = hash_lookup_get_hash (h, category_set, &hash);
+  ptrdiff_t i = lisp_hash_lookup_get_hash (h, category_set, &hash);
   if (i >= 0)
     return HASH_KEY (h, i);
-  hash_put (h, category_set, Qnil, hash);
+  lisp_hash_put (h, category_set, Qnil, hash);
   return category_set;
 }

diff --git a/src/ccl.c b/src/ccl.c
index a45fe0439c4..dfb50be71ac 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1375,7 +1375,7 @@ #define EXCMD (field1 >> 6)

 		eop = (FIXNUM_OVERFLOW_P (reg[RRR])
 		       ? -1
-		       : hash_lookup (h, make_fixnum (reg[RRR])));
+		       : lisp_hash_lookup (h, make_fixnum (reg[RRR])));
 		if (eop >= 0)
 		  {
 		    Lisp_Object opl;
@@ -1404,7 +1404,7 @@ #define EXCMD (field1 >> 6)

 		eop = (FIXNUM_OVERFLOW_P (i)
 		       ? -1
-		       : hash_lookup (h, make_fixnum (i)));
+		       : lisp_hash_lookup (h, make_fixnum (i)));
 		if (eop >= 0)
 		  {
 		    Lisp_Object opl;
diff --git a/src/charset.c b/src/charset.c
index 797dfde276f..d66476a79b9 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1112,7 +1112,7 @@ DEFUN ("define-charset-internal", Fdefine_charset_internal,

   hash_hash_t hash_code;
   ptrdiff_t hash_index
-    = hash_lookup_get_hash (hash_table, args[charset_arg_name],
+    = lisp_hash_lookup_get_hash (hash_table, args[charset_arg_name],
 			    &hash_code);
   if (hash_index >= 0)
     {
@@ -1122,7 +1122,7 @@ DEFUN ("define-charset-internal", Fdefine_charset_internal,
     }
   else
     {
-      hash_put (hash_table, args[charset_arg_name], attrs, hash_code);
+      lisp_hash_put (hash_table, args[charset_arg_name], attrs, hash_code);
       if (charset_table_used == charset_table_size)
 	{
 	  /* Ensure that charset IDs fit into 'int' as well as into the
diff --git a/src/charset.h b/src/charset.h
index 0217ec321ff..def4d13180d 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -285,7 +285,7 @@ #define CHARSET_SYMBOL_ID(symbol)	\
 /* Return an index to Vcharset_hash_table of the charset whose symbol
    is SYMBOL.  */
 #define CHARSET_SYMBOL_HASH_INDEX(symbol)	\
-  hash_lookup (XHASH_TABLE (Vcharset_hash_table), symbol)
+  lisp_hash_lookup (XHASH_TABLE (Vcharset_hash_table), symbol)

 /* Return the attribute vector of CHARSET.  */
 #define CHARSET_ATTRIBUTES(charset) (charset)->attributes
diff --git a/src/coding.h b/src/coding.h
index b72ffde3c55..73c3aa3bfc2 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -193,8 +193,8 @@ #define CODING_SYSTEM_SPEC(coding_system_symbol)	\
 /* Return the ID of CODING_SYSTEM_SYMBOL.  */

 #define CODING_SYSTEM_ID(coding_system_symbol)			\
-  hash_lookup (XHASH_TABLE (Vcoding_system_hash_table),		\
-	       coding_system_symbol)
+  lisp_hash_lookup (XHASH_TABLE (Vcoding_system_hash_table),		\
+		    coding_system_symbol)

 /* Return true if CODING_SYSTEM_SYMBOL is a coding system.  */

diff --git a/src/composite.c b/src/composite.c
index 2ef72a33d2e..9f6554fa74a 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -241,7 +241,7 @@ get_composition_id (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t nchars,
     goto invalid_composition;

   hash_hash_t hash_code;
-  hash_index = hash_lookup_get_hash (hash_table, key, &hash_code);
+  hash_index = lisp_hash_lookup_get_hash (hash_table, key, &hash_code);
   if (hash_index >= 0)
     {
       /* We have already registered the same composition.  Change PROP
@@ -302,7 +302,7 @@ get_composition_id (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t nchars,
   XSETCDR (prop, Fcons (make_fixnum (nchars), Fcons (key, XCDR (prop))));

   /* Register the composition in composition_hash_table.  */
-  hash_index = hash_put (hash_table, key, id, hash_code);
+  hash_index = lisp_hash_put (hash_table, key, id, hash_code);

   method = (NILP (components)
 	    ? COMPOSITION_RELATIVE
@@ -664,7 +664,7 @@ composition_gstring_put_cache (Lisp_Object gstring, ptrdiff_t len)
   LGSTRING_SET_HEADER (copy, Fcopy_sequence (header));
   for (ptrdiff_t i = 0; i < len; i++)
     LGSTRING_SET_GLYPH (copy, i, Fcopy_sequence (LGSTRING_GLYPH (gstring, i)));
-  ptrdiff_t id = hash_put (h, LGSTRING_HEADER (copy), copy, hash);
+  ptrdiff_t id = lisp_hash_put (h, LGSTRING_HEADER (copy), copy, hash);
   LGSTRING_SET_ID (copy, make_fixnum (id));
   return copy;
 }
@@ -686,7 +686,7 @@ composition_gstring_cache_clear_font (Lisp_Object font_object)

   DOHASH (h, k, gstring)
     if (EQ (LGSTRING_FONT (gstring), font_object))
-      hash_remove_from_table (h, k);
+      lisp_hash_remove_from_table (h, k);
 }

 DEFUN ("clear-composition-cache", Fclear_composition_cache,
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 7797b04e026..b535aff5fcd 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -431,7 +431,7 @@ module_make_global_ref (emacs_env *env, emacs_value value)
   struct Lisp_Hash_Table *h = XHASH_TABLE (Vmodule_refs_hash);
   Lisp_Object new_obj = value_to_lisp (value);
   hash_hash_t hashcode;
-  ptrdiff_t i = hash_lookup_get_hash (h, new_obj, &hashcode);
+  ptrdiff_t i = lisp_hash_lookup_get_hash (h, new_obj, &hashcode);

   /* Note: This approach requires the garbage collector to never move
      objects.  */
@@ -455,7 +455,7 @@ module_make_global_ref (emacs_env *env, emacs_value value)
       ref->refcount = 1;
       Lisp_Object value;
       XSETPSEUDOVECTOR (value, ref, PVEC_OTHER);
-      hash_put (h, new_obj, value, hashcode);
+      lisp_hash_put (h, new_obj, value, hashcode);
       MODULE_INTERNAL_CLEANUP ();
       return &ref->value;
     }
@@ -470,7 +470,7 @@ module_free_global_ref (emacs_env *env, emacs_value global_value)
   MODULE_FUNCTION_BEGIN ();
   struct Lisp_Hash_Table *h = XHASH_TABLE (Vmodule_refs_hash);
   Lisp_Object obj = value_to_lisp (global_value);
-  ptrdiff_t i = hash_lookup (h, obj);
+  ptrdiff_t i = lisp_hash_lookup (h, obj);

   if (module_assertions)
     {
@@ -486,7 +486,7 @@ module_free_global_ref (emacs_env *env, emacs_value global_value)
       struct module_global_reference *ref = XMODULE_GLOBAL_REFERENCE (value);
       eassert (0 < ref->refcount);
       if (--ref->refcount == 0)
-        hash_remove_from_table (h, obj);
+        lisp_hash_remove_from_table (h, obj);
     }

   MODULE_INTERNAL_CLEANUP ();
diff --git a/src/fns.c b/src/fns.c
index 3f109a81836..c1572d11ea9 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2858,7 +2858,7 @@ internal_equal_1 (Lisp_Object o1, Lisp_Object o2, enum equal_kind equal_kind,
 		  set_hash_value_slot (h, i, Fcons (o2, o2s));
 	      }
 	    else
-	      hash_put (h, o1, Fcons (o2, Qnil), hash);
+	      lisp_hash_put (h, o1, Fcons (o2, Qnil), hash);
 	  }
 	default: ;
 	}
@@ -5050,7 +5050,7 @@ hash_lookup_with_hash (struct Lisp_Hash_Table *h,

 /* Look up KEY in table H.  Return entry index or -1 if none.  */
 ptrdiff_t
-hash_lookup (struct Lisp_Hash_Table *h, Lisp_Object key)
+lisp_hash_lookup (struct Lisp_Hash_Table *h, Lisp_Object key)
 {
   return hash_lookup_with_hash (h, key, hash_from_key (h, key));
 }
@@ -5058,8 +5058,8 @@ hash_lookup (struct Lisp_Hash_Table *h, Lisp_Object key)
 /* Look up KEY in hash table H.  Return its hash value in *PHASH.
    Value is the index of the entry in H matching KEY, or -1 if not found.  */
 ptrdiff_t
-hash_lookup_get_hash (struct Lisp_Hash_Table *h, Lisp_Object key,
-		      hash_hash_t *phash)
+lisp_hash_lookup_get_hash (struct Lisp_Hash_Table *h, Lisp_Object key,
+			   hash_hash_t *phash)
 {
   EMACS_UINT hash = hash_from_key (h, key);
   *phash = hash;
@@ -5078,8 +5078,8 @@ check_mutable_hash_table (Lisp_Object obj, struct Lisp_Hash_Table *h)
    Value is the index of the entry in H matching KEY.  */

 ptrdiff_t
-hash_put (struct Lisp_Hash_Table *h, Lisp_Object key, Lisp_Object value,
-	  hash_hash_t hash)
+lisp_hash_put (struct Lisp_Hash_Table *h, Lisp_Object key, Lisp_Object value,
+	       hash_hash_t hash)
 {
   eassert (!hash_unused_entry_key_p (key));
   /* Increment count after resizing because resizing may fail.  */
@@ -5107,7 +5107,7 @@ hash_put (struct Lisp_Hash_Table *h, Lisp_Object key, Lisp_Object value,
 /* Remove the entry matching KEY from hash table H, if there is one.  */

 void
-hash_remove_from_table (struct Lisp_Hash_Table *h, Lisp_Object key)
+lisp_hash_remove_from_table (struct Lisp_Hash_Table *h, Lisp_Object key)
 {
   hash_hash_t hashval = hash_from_key (h, key);
   ptrdiff_t start_of_bucket = hash_index_index (h, hashval);
@@ -5288,7 +5288,7 @@ #define SXHASH_MAX_LEN   7
    can be any EMACS_UINT value.  */

 EMACS_UINT
-hash_string (char const *ptr, ptrdiff_t len)
+lisp_hash_string (char const *ptr, ptrdiff_t len)
 {
   char const *p   = ptr;
   char const *end = ptr + len;
@@ -5461,7 +5461,7 @@ sxhash_obj (Lisp_Object obj, int depth)
       return XHASH (obj);

     case Lisp_String:
-      return hash_string (SSDATA (obj), SBYTES (obj));
+      return lisp_hash_string (SSDATA (obj), SBYTES (obj));

     case Lisp_Vectorlike:
       {
@@ -5863,7 +5863,7 @@ DEFUN ("gethash", Fgethash, Sgethash, 2, 3, 0,
   (Lisp_Object key, Lisp_Object table, Lisp_Object dflt)
 {
   struct Lisp_Hash_Table *h = check_hash_table (table);
-  ptrdiff_t i = hash_lookup (h, key);
+  ptrdiff_t i = lisp_hash_lookup (h, key);
   return i >= 0 ? HASH_VALUE (h, i) : dflt;
 }

@@ -5882,7 +5882,7 @@ DEFUN ("puthash", Fputhash, Sputhash, 3, 3, 0,
   if (i >= 0)
     set_hash_value_slot (h, i, value);
   else
-    hash_put (h, key, value, hash);
+    lisp_hash_put (h, key, value, hash);

   return value;
 }
@@ -5894,7 +5894,7 @@ DEFUN ("remhash", Fremhash, Sremhash, 2, 2, 0,
 {
   struct Lisp_Hash_Table *h = check_hash_table (table);
   check_mutable_hash_table (table, h);
-  hash_remove_from_table (h, key);
+  lisp_hash_remove_from_table (h, key);
   return Qnil;
 }

diff --git a/src/image.c b/src/image.c
index 65d8db24adc..b6f04a275fd 100644
--- a/src/image.c
+++ b/src/image.c
@@ -5552,7 +5552,7 @@ xpm_free_color_cache (void)
 static int
 xpm_color_bucket (char *color_name)
 {
-  EMACS_UINT hash = hash_string (color_name, strlen (color_name));
+  EMACS_UINT hash = lisp_hash_string (color_name, strlen (color_name));
   return hash % XPM_COLOR_CACHE_BUCKETS;
 }

@@ -6238,8 +6238,8 @@ xpm_put_color_table_h (Lisp_Object color_table,
   Lisp_Object chars = make_unibyte_string (chars_start, chars_len);

   hash_hash_t hash_code;
-  hash_lookup_get_hash (table, chars, &hash_code);
-  hash_put (table, chars, color, hash_code);
+  lisp_hash_lookup_get_hash (table, chars, &hash_code);
+  lisp_hash_put (table, chars, color, hash_code);
 }

 static Lisp_Object
@@ -6249,7 +6249,7 @@ xpm_get_color_table_h (Lisp_Object color_table,
 {
   struct Lisp_Hash_Table *table = XHASH_TABLE (color_table);
   ptrdiff_t i =
-    hash_lookup (table, make_unibyte_string (chars_start, chars_len));
+    lisp_hash_lookup (table, make_unibyte_string (chars_start, chars_len));

   return i >= 0 ? HASH_VALUE (table, i) : Qnil;
 }
diff --git a/src/json.c b/src/json.c
index 5795c582ce0..f633215aca0 100644
--- a/src/json.c
+++ b/src/json.c
@@ -1571,9 +1571,9 @@ json_parse_object (struct json_parser *parser)
 	    hash_hash_t hash;
 	    Lisp_Object key = parser->object_workspace[i];
 	    Lisp_Object value = parser->object_workspace[i + 1];
-	    ptrdiff_t i = hash_lookup_get_hash (h, key, &hash);
+	    ptrdiff_t i = lisp_hash_lookup_get_hash (h, key, &hash);
 	    if (i < 0)
-	      hash_put (h, key, value, hash);
+	      lisp_hash_put (h, key, value, hash);
 	    else
 	      set_hash_value_slot (h, i, value);
 	  }
diff --git a/src/lisp.h b/src/lisp.h
index 243e8cc7f36..6d78836db3d 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4261,17 +4261,17 @@ #define CONS_TO_INTEGER(cons, type, var)				\
 extern bool sweep_weak_table (struct Lisp_Hash_Table *, bool);
 extern void hexbuf_digest (char *, void const *, int);
 extern char *extract_data_from_object (Lisp_Object, ptrdiff_t *, ptrdiff_t *);
-EMACS_UINT hash_string (char const *, ptrdiff_t);
+EMACS_UINT lisp_hash_string (char const *, ptrdiff_t);
 EMACS_UINT sxhash (Lisp_Object);
 Lisp_Object make_hash_table (const struct hash_table_test *, EMACS_INT,
                              hash_table_weakness_t);
 Lisp_Object hash_table_weakness_symbol (hash_table_weakness_t weak);
-ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object);
-ptrdiff_t hash_lookup_get_hash (struct Lisp_Hash_Table *h, Lisp_Object key,
-				hash_hash_t *phash);
-ptrdiff_t hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object,
-		    hash_hash_t);
-void hash_remove_from_table (struct Lisp_Hash_Table *, Lisp_Object);
+ptrdiff_t lisp_hash_lookup (struct Lisp_Hash_Table *, Lisp_Object);
+ptrdiff_t lisp_hash_lookup_get_hash (struct Lisp_Hash_Table *h, Lisp_Object key,
+				     hash_hash_t *phash);
+ptrdiff_t lisp_hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object,
+			 hash_hash_t);
+void lisp_hash_remove_from_table (struct Lisp_Hash_Table *, Lisp_Object);
 extern struct hash_table_test const hashtest_eq, hashtest_eql, hashtest_equal;
 extern void validate_subarray (Lisp_Object, Lisp_Object, Lisp_Object,
 			       ptrdiff_t, ptrdiff_t *, ptrdiff_t *);
diff --git a/src/lread.c b/src/lread.c
index add8deb3954..90759c9386c 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4258,12 +4258,12 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
 			  = XHASH_TABLE (read_objects_map);
 			Lisp_Object number = make_fixnum (n);
 			hash_hash_t hash;
-			ptrdiff_t i = hash_lookup_get_hash (h, number, &hash);
+			ptrdiff_t i = lisp_hash_lookup_get_hash (h, number, &hash);
 			if (i >= 0)
 			  /* Not normal, but input could be malformed.  */
 			  set_hash_value_slot (h, i, placeholder);
 			else
-			  hash_put (h, number, placeholder, hash);
+			  lisp_hash_put (h, number, placeholder, hash);
 			read_stack_push ((struct read_stack_entry) {
 			    .type = RE_numbered,
 			    .u.numbered.number = number,
@@ -4276,7 +4276,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
 			/* #N# -- reference to numbered object */
 			struct Lisp_Hash_Table *h
 			  = XHASH_TABLE (read_objects_map);
-			ptrdiff_t i = hash_lookup (h, make_fixnum (n));
+			ptrdiff_t i = lisp_hash_lookup (h, make_fixnum (n));
 			if (i < 0)
 			  INVALID_SYNTAX_WITH_BUFFER ();
 			obj = HASH_VALUE (h, i);
@@ -4571,9 +4571,9 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
 		struct Lisp_Hash_Table *h2
 		  = XHASH_TABLE (read_objects_completed);
 		hash_hash_t hash;
-		ptrdiff_t i = hash_lookup_get_hash (h2, placeholder, &hash);
+		ptrdiff_t i = lisp_hash_lookup_get_hash (h2, placeholder, &hash);
 		eassert (i < 0);
-		hash_put (h2, placeholder, Qnil, hash);
+		lisp_hash_put (h2, placeholder, Qnil, hash);
 		obj = placeholder;
 	      }
 	    else
@@ -4586,9 +4586,9 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
 		    struct Lisp_Hash_Table *h2
 		      = XHASH_TABLE (read_objects_completed);
 		    hash_hash_t hash;
-		    ptrdiff_t i = hash_lookup_get_hash (h2, obj, &hash);
+		    ptrdiff_t i = lisp_hash_lookup_get_hash (h2, obj, &hash);
 		    eassert (i < 0);
-		    hash_put (h2, obj, Qnil, hash);
+		    lisp_hash_put (h2, obj, Qnil, hash);
 		  }

 		/* Now put it everywhere the placeholder was...  */
@@ -4598,7 +4598,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
 		/* ...and #n# will use the real value from now on.  */
 		struct Lisp_Hash_Table *h = XHASH_TABLE (read_objects_map);
 		hash_hash_t hash;
-		ptrdiff_t i = hash_lookup_get_hash (h, e->u.numbered.number,
+		ptrdiff_t i = lisp_hash_lookup_get_hash (h, e->u.numbered.number,
 						    &hash);
 		eassert (i >= 0);
 		set_hash_value_slot (h, i, obj);
@@ -4653,7 +4653,7 @@ substitute_object_recurse (struct subst *subst, Lisp_Object subtree)
      by #n=, which means that we can find it as a value in
      COMPLETED.  */
   if (EQ (subst->completed, Qt)
-      || hash_lookup (XHASH_TABLE (subst->completed), subtree) >= 0)
+      || lisp_hash_lookup (XHASH_TABLE (subst->completed), subtree) >= 0)
     subst->seen = Fcons (subtree, subst->seen);

   /* Recurse according to subtree's type.
@@ -5165,7 +5165,7 @@ DEFUN ("unintern", Funintern, Sunintern, 2, 2, 0,
 static ptrdiff_t
 obarray_index (struct Lisp_Obarray *oa, const char *str, ptrdiff_t size_byte)
 {
-  EMACS_UINT hash = hash_string (str, size_byte);
+  EMACS_UINT hash = lisp_hash_string (str, size_byte);
   return knuth_hash (reduce_emacs_uint_to_hash_hash (hash), oa->size_bits);
 }

diff --git a/src/minibuf.c b/src/minibuf.c
index b0d54bd51f0..234d730aac0 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -2103,7 +2103,7 @@ DEFUN ("test-completion", Ftest_completion, Stest_completion, 2, 3, 0,
   else if (HASH_TABLE_P (collection))
     {
       struct Lisp_Hash_Table *h = XHASH_TABLE (collection);
-      ptrdiff_t i = hash_lookup (h, string);
+      ptrdiff_t i = lisp_hash_lookup (h, string);
       if (i >= 0)
         {
           tem = HASH_KEY (h, i);
--
2.35.1