0001-tftpd_pcre.c-fix-build-with-pcre2-10.43.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From e75d656e1e3465dea1fdf605cb8fe7e25286bdd3 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sun, 12 May 2024 18:29:09 +0200
  4. Subject: [PATCH] tftpd_pcre.c: fix build with pcre2 >= 10.43
  5. Fix the following build failure raised since pcre2 >= 10.43 and
  6. https://github.com/PCRE2Project/pcre2/commit/014c82d7bcc2873cdb1f3abc5e5348587f477ba4:
  7. tftpd_pcre.c: In function 'tftpd_pcre_open':
  8. tftpd_pcre.c:109:37: error: passing argument 1 of 'pcre2_substring_list_free_8' from incompatible pointer type [-Wincompatible-pointer-types]
  9. 109 | pcre2_substring_list_free((const PCRE2_UCHAR **)substrlist);
  10. | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  11. | |
  12. | const PCRE2_UCHAR8 ** {aka const unsigned char **}
  13. In file included from tftpd_pcre.h:24,
  14. from tftpd_pcre.c:35:
  15. /home/autobuild/autobuild/instance-10/output-1/host/powerpc64le-buildroot-linux-gnu/sysroot/usr/include/pcre2.h:949:1: note: expected 'PCRE2_UCHAR8 **' {aka 'unsigned char **'} but argument is of type 'const PCRE2_UCHAR8 **' {aka 'const unsigned char **'}
  16. 949 | PCRE2_TYPES_STRUCTURES_AND_FUNCTIONS
  17. | ^
  18. Fixes:
  19. - http://autobuild.buildroot.org/results/46565c834a8162a651944885104027610a65f9c3
  20. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  21. Upstream: https://github.com/madmartin/atftp/pull/1
  22. ---
  23. tftpd_pcre.c | 2 +-
  24. 1 file changed, 1 insertion(+), 1 deletion(-)
  25. diff --git a/tftpd_pcre.c b/tftpd_pcre.c
  26. index 24b2770..7b3d0e3 100644
  27. --- a/tftpd_pcre.c
  28. +++ b/tftpd_pcre.c
  29. @@ -106,7 +106,7 @@ tftpd_pcre_self_t *tftpd_pcre_open(char *filename)
  30. logger(LOG_DEBUG,"file: %s line: %d substring: %d value: %s",
  31. filename, linecount, subnum, substrlist[subnum]);
  32. }
  33. - pcre2_substring_list_free((const PCRE2_UCHAR **)substrlist);
  34. + pcre2_substring_list_free(substrlist);
  35. if (matches != 3)
  36. {
  37. --
  38. 2.43.0