From 6a0389929d8951ff0652cd5979021d503dfa4695 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 2 Sep 2025 13:45:41 +0200 Subject: [PATCH 1/2] Fix incompatible-pointer-types for pcre2_substring_list_free This change fixes the following compilation build error: 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 --- tftpd_pcre.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tftpd_pcre.c b/tftpd_pcre.c index 24b2770..28287f6 100644 --- a/tftpd_pcre.c +++ b/tftpd_pcre.c @@ -106,7 +106,7 @@ tftpd_pcre_self_t *tftpd_pcre_open(char *filename) 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) { From d3fc75612d54a79fe205393e386874e07c64654c Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 2 Sep 2025 13:53:05 +0200 Subject: [PATCH 2/2] Fix pthread_t format warning for fprintf This change fixes the following compilation build warning: logger.c:117:47: warning: format '%li' expects argument of type 'long int', but argument 7 has type 'pthread_t' {aka 'struct __pthread *'} [-Wformat=] 117 | fprintf(log_fp, "%s %s %s[%d.%li]: %s\n", time_buf, hostname, | ~~^ | | | long int 118 | log_ident, getpid(), pthread_self(), message); | ~~~~~~~~~~~~~~ | | | pthread_t {aka struct __pthread *} logger.c:124:47: warning: format '%li' expects argument of type 'long int', but argument 7 has type 'pthread_t' {aka 'struct __pthread *'} [-Wformat=] 124 | fprintf(stderr, "%s %s %s[%d.%li]: %s\n", time_buf, hostname, | ~~^ | | | long int 125 | log_ident, getpid(), pthread_self(), message); | ~~~~~~~~~~~~~~ | | | pthread_t {aka struct __pthread *} Signed-off-by: Florian Eckert --- logger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logger.c b/logger.c index b9243b1..dc304de 100644 --- a/logger.c +++ b/logger.c @@ -115,14 +115,14 @@ void logger(int severity, const char *fmt, ...) if (log_fp) { fprintf(log_fp, "%s %s %s[%d.%li]: %s\n", time_buf, hostname, - log_ident, getpid(), pthread_self(), message); + log_ident, getpid(), (unsigned long int) pthread_self(), message); fflush(log_fp); } else if (log_syslog_is_open) syslog(severity, "%s", message); else fprintf(stderr, "%s %s %s[%d.%li]: %s\n", time_buf, hostname, - log_ident, getpid(), pthread_self(), message); + log_ident, getpid(), (unsigned long int) pthread_self(), message); } va_end(args); }