commit:     a5e6a6d51e03408edadbee16bb7e8b5cc1e8883a
Author:     NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Tue Jan 21 16:34:46 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Feb 10 09:00:22 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5e6a6d5

net-dns/idnkit: Fix incompatible pointers

Part of modern C conversion

Bug: https://bugs.gentoo.org/919224
Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/40248
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/idnkit-2.3-incompatible-pointers.patch   | 29 ++++++++++++++++++++++
 .../{idnkit-2.3-r1.ebuild => idnkit-2.3-r2.ebuild} |  4 ++-
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/net-dns/idnkit/files/idnkit-2.3-incompatible-pointers.patch 
b/net-dns/idnkit/files/idnkit-2.3-incompatible-pointers.patch
new file mode 100644
index 000000000000..130d18b2307f
--- /dev/null
+++ b/net-dns/idnkit/files/idnkit-2.3-incompatible-pointers.patch
@@ -0,0 +1,29 @@
+Fix incompatible pointers for modern C, hope that restrict qualifier
+holds in this scenario
+https://bugs.gentoo.org/919224
+--- a/lib/localconverter.c
++++ b/lib/localconverter.c
+@@ -599,12 +599,12 @@
+       inleft = 0;
+       outbuf = NULL;
+       outleft = 0;
+-      iconv(ictx, (const char **)NULL, &inleft, &outbuf, &outleft);
++      iconv(ictx, NULL, &inleft, &outbuf, &outleft);
+ 
+       inleft = strlen(from);
+       inbuf = from;
+       outleft = tolen - 1;    /* reserve space for terminating NUL */
+-      sz = iconv(ictx, (const char **)&inbuf, &inleft, &to, &outleft);
++      sz = iconv(ictx, (char ** restrict)&inbuf, &inleft, &to, &outleft);
+ 
+       if (sz == (size_t)(-1) || inleft > 0) {
+               switch (errno) {
+@@ -630,7 +630,7 @@
+        * Append a sequence of state reset.
+        */
+       inleft = 0;
+-      sz = iconv(ictx, (const char **)NULL, &inleft, &to, &outleft);
++      sz = iconv(ictx, NULL, &inleft, &to, &outleft);
+       if (sz == (size_t)(-1)) {
+               switch (errno) {
+               case EILSEQ:

diff --git a/net-dns/idnkit/idnkit-2.3-r1.ebuild 
b/net-dns/idnkit/idnkit-2.3-r2.ebuild
similarity index 84%
rename from net-dns/idnkit/idnkit-2.3-r1.ebuild
rename to net-dns/idnkit/idnkit-2.3-r2.ebuild
index 67dd9b43e2e0..3a20fa937d68 100644
--- a/net-dns/idnkit/idnkit-2.3-r1.ebuild
+++ b/net-dns/idnkit/idnkit-2.3-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -19,6 +19,8 @@ DEPEND="
        dev-lang/perl
 "
 
+PATCHES=( "${FILESDIR}"/"${P}"-incompatible-pointers.patch )
+
 src_configure() {
        econf $(use_enable liteonly)
 }

Reply via email to