]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: ssl: strchr definition changed in C23
authorWilliam Lallemand <wlallemand@irq6.net>
Wed, 7 Jan 2026 13:31:30 +0000 (14:31 +0100)
committerWilliam Lallemand <wlallemand@irq6.net>
Wed, 7 Jan 2026 13:51:26 +0000 (14:51 +0100)
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/ssl_sock.c: In function ‘SSL_CTX_keylog’:
src/ssl_sock.c:4475:17: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
 4475 |         lastarg = strrchr(line, ' ');

Strangely, -Wdiscarded-qualifiers does not seem to catch all the
strrchr.

Should fix issue #3228.

This could be backported in previous versions.

src/ssl_sock.c

index 0f18132b197e7e01643d4f1fb7ff040c0406de29..a8168830964647f4558d2cb31251fa5c9e69a641 100644 (file)
@@ -4462,7 +4462,7 @@ static void ssl_set_shctx(SSL_CTX *ctx)
 static void SSL_CTX_keylog(const SSL *ssl, const char *line)
 {
        struct ssl_keylog *keylog;
-       char *lastarg = NULL;
+       const char *lastarg = NULL;
        char *dst = NULL;
 
 #ifdef USE_QUIC_OPENSSL_COMPAT