Paul Eggert wrote on 2025-09-17:
> Thanks for the careful review. I installed the patch with the
> corrections you suggested
Well, there is now a compilation error in gen-uni-tables.c:
$ gcc -ggdb -Wall gen-uni-tables.c -Iunictype -o gen-uni-tables
gen-uni-tables.c: In function ‘str_endswith’:
gen-uni-tables.c:67:22: error: implicit declaration of function ‘streq’; did
you mean ‘strsep’? [-Wimplicit-function-declaration]
67 | return len >= n && streq (string + len - n, suffix);
| ^~~~~
| strsep
gen-uni-tables.c: At top level:
gen-uni-tables.c:77:1: error: conflicting types for ‘streq’; have ‘_Bool(const
char *, const char *)’
77 | streq (char const *s1, char const *s2)
| ^~~~~
gen-uni-tables.c:67:22: note: previous implicit declaration of ‘streq’ with
type ‘int()’
67 | return len >= n && streq (string + len - n, suffix);
| ^~~~~
Fixed through this patch:
2025-09-23 Bruno Haible <[email protected]>
gen-uni-tables: Fix compilation error (regression 2025-09-17).
* lib/gen-uni-tables.c (streq, memeq): Move definitions before their
first use.
>From e3fb6645d74b86752592a885156344ce034c1e38 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Tue, 23 Sep 2025 21:44:46 +0200
Subject: [PATCH] gen-uni-tables: Fix compilation error (regression
2025-09-17).
* lib/gen-uni-tables.c (streq, memeq): Move definitions before their
first use.
---
ChangeLog | 6 ++++++
lib/gen-uni-tables.c | 20 ++++++++++----------
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 02df4f6732..a942e53a40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-09-23 Bruno Haible <[email protected]>
+
+ gen-uni-tables: Fix compilation error (regression 2025-09-17).
+ * lib/gen-uni-tables.c (streq, memeq): Move definitions before their
+ first use.
+
2025-09-23 Bruno Haible <[email protected]>
Clarify link dependency towards libgcrypt or OpenSSL's libcrypto.
diff --git a/lib/gen-uni-tables.c b/lib/gen-uni-tables.c
index 97f8ff4b0d..00c52fe757 100644
--- a/lib/gen-uni-tables.c
+++ b/lib/gen-uni-tables.c
@@ -54,29 +54,29 @@
/* Utility functions. */
static bool
-str_startswith (const char *string, const char *prefix)
+streq (char const *s1, char const *s2)
{
- return strncmp (string, prefix, strlen (prefix)) == 0;
+ return strcmp (s1, s2) == 0;
}
static bool
-str_endswith (const char *string, const char *suffix)
+memeq (void const *s1, void const *s2, size_t n)
{
- size_t len = strlen (string);
- size_t n = strlen (suffix);
- return len >= n && streq (string + len - n, suffix);
+ return memcmp (s1, s2, n) == 0;
}
static bool
-memeq (void const *s1, void const *s2, size_t n)
+str_startswith (const char *string, const char *prefix)
{
- return !memcmp (s1, s2, n);
+ return strncmp (string, prefix, strlen (prefix)) == 0;
}
static bool
-streq (char const *s1, char const *s2)
+str_endswith (const char *string, const char *suffix)
{
- return !strcmp (s1, s2);
+ size_t len = strlen (string);
+ size_t n = strlen (suffix);
+ return len >= n && streq (string + len - n, suffix);
}
/* ========================================================================= */
--
2.51.0