From 25e3d95e2242b1e7cd9f3331bfb76f3d1336b9ff Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.funk1@gmail.com>
Date: Wed, 23 Apr 2025 20:29:25 -0700
Subject: [PATCH] tsearch tests: Disable tfind signature check on Cygwin.

* tests/test-tsearch.c [__CYGWIN__]: Skip the tfind signature check.
* doc/posix-functions/tfind.texi: Mention the Cygwin signature.
---
 ChangeLog                      | 6 ++++++
 doc/posix-functions/tfind.texi | 5 +++++
 tests/test-tsearch.c           | 4 +++-
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 10925dd95b..0220d60239 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-04-23  Collin Funk  <collin.funk1@gmail.com>
+
+	tsearch tests: Disable tfind signature check on Cygwin.
+	* tests/test-tsearch.c [__CYGWIN__]: Skip the tfind signature check.
+	* doc/posix-functions/tfind.texi: Mention the Cygwin signature.
+
 2025-04-22  Collin Funk  <collin.funk1@gmail.com>
 
 	random_r tests: Disable signature check on Haiku.
diff --git a/doc/posix-functions/tfind.texi b/doc/posix-functions/tfind.texi
index 384b08fd60..416aa42498 100644
--- a/doc/posix-functions/tfind.texi
+++ b/doc/posix-functions/tfind.texi
@@ -15,4 +15,9 @@ Minix 3.1.8, mingw, MSVC 14, Android 4.0.4.
 
 Portability problems not fixed by Gnulib:
 @itemize
+@item
+This function uses @code{void **} instead of @code{void *const *} for
+the second parameter on some platforms:
+@c https://cygwin.com/pipermail/cygwin/2025-April/258032.html
+Cygwin.
 @end itemize
diff --git a/tests/test-tsearch.c b/tests/test-tsearch.c
index a741f22b44..ea41505dd6 100644
--- a/tests/test-tsearch.c
+++ b/tests/test-tsearch.c
@@ -1,5 +1,5 @@
 /* Test program for tsearch et al.
-   Copyright (C) 1997, 2000-2001, 2007-2024 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2000-2001, 2007-2025 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software: you can redistribute it and/or
@@ -22,8 +22,10 @@
 #include "signature.h"
 SIGNATURE_CHECK (tdelete, void *, (void const *, void **,
                                    int (*) (void const *, void const *)));
+#if !defined __CYGWIN__
 SIGNATURE_CHECK (tfind, void *, (void const *, void * const *,
                                  int (*) (void const *, void const *)));
+#endif
 SIGNATURE_CHECK (tsearch, void *, (void const *, void **,
                                    int (*) (void const *, void const *)));
 SIGNATURE_CHECK (twalk, void, (void const *,
-- 
2.39.5