From 4aff6d1c2550807fb67da56ad15fade8ab4a6d8d Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Wed, 7 Jan 2026 14:41:06 +0100 Subject: [PATCH] BUILD: tools: memchr definition changed in C23 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New gcc and clang versions from fedora rawhide seems to use the C23 standard by default. This version changes the definition of some string.h functions, which now return a const char * instead of a char *. src/tools.c: In function ‘fgets_from_mem’: src/tools.c:7200:17: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 7200 | new_pos = memchr(*position, '\n', size); | ^ Strangely, -Wdiscarded-qualifiers does not seem to catch all the memchr. Should fix issue #3228. This could be backported in previous versions. --- src/tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools.c b/src/tools.c index 50101bc63..460a34e18 100644 --- a/src/tools.c +++ b/src/tools.c @@ -7182,7 +7182,7 @@ REGISTER_PER_THREAD_INIT(init_tools_per_thread); */ char *fgets_from_mem(char* buf, int size, const char **position, const char *end) { - char *new_pos; + const char *new_pos; int len = 0; /* keep fgets behaviour */