atftp: add patch to fix build error
authorFlorian Eckert <[email protected]>
Tue, 2 Sep 2025 12:11:08 +0000 (14:11 +0200)
committerFlorian Eckert <[email protected]>
Mon, 8 Sep 2025 07:20:43 +0000 (09:20 +0200)
This patch fixes the following compilation build error for gcc14:

tftpd_pcre.c:109:37: error: passing argument 1 of 'pcre2_substring_list_free_8' from incompatible p
  109 |           pcre2_substring_list_free((const PCRE2_UCHAR **)substrlist);
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                     |
      |                                     const PCRE2_UCHAR8 ** {aka const unsigned char **}
In file included from tftpd_pcre.h:24,
                 from tftpd_pcre.c:35:

I have also submitted the change to the upstream project:
https://github.com/madmartin/atftp/pull/2

Signed-off-by: Florian Eckert <[email protected]>
net/atftp/patches/0001-Fix-incompatible-pointer-types-for-pcre2_substring_l.patch [new file with mode: 0644]

diff --git a/net/atftp/patches/0001-Fix-incompatible-pointer-types-for-pcre2_substring_l.patch b/net/atftp/patches/0001-Fix-incompatible-pointer-types-for-pcre2_substring_l.patch
new file mode 100644 (file)
index 0000000..ce9b7b8
--- /dev/null
@@ -0,0 +1,32 @@
+From 7f45d2c5e217433039c827d29aaa9f704b773119 Mon Sep 17 00:00:00 2001
+From: Florian Eckert <[email protected]>
+Date: Tue, 2 Sep 2025 13:45:41 +0200
+Subject: [PATCH] Fix incompatible-pointer-types for
+ pcre2_substring_list_free
+
+This change fixes the following compilation build error for gcc14:
+
+tftpd_pcre.c:109:37: error: passing argument 1 of 'pcre2_substring_list_free_8' from incompatible pointer type [-Wincompatible-pointer-types]
+  109 |           pcre2_substring_list_free((const PCRE2_UCHAR **)substrlist);
+      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+      |                                     |
+      |                                     const PCRE2_UCHAR8 ** {aka const unsigned char **}
+In file included from tftpd_pcre.h:24,
+                 from tftpd_pcre.c:35:
+
+Signed-off-by: Florian Eckert <[email protected]>
+---
+ tftpd_pcre.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/tftpd_pcre.c
++++ b/tftpd_pcre.c
+@@ -106,7 +106,7 @@ tftpd_pcre_self_t *tftpd_pcre_open(char
+                logger(LOG_DEBUG,"file: %s line: %d substring: %d value: %s",
+                       filename, linecount, subnum, substrlist[subnum]);
+           }
+-          pcre2_substring_list_free((const PCRE2_UCHAR **)substrlist);
++          pcre2_substring_list_free((PCRE2_UCHAR **)substrlist);
+           if (matches != 3)
+           {