]> git.ipfire.org Git - thirdparty/systemd.git/commit
tree-wide: Fix constness issues with newer glibc 40868/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 25 Nov 2025 15:46:04 +0000 (16:46 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 27 Feb 2026 21:57:05 +0000 (21:57 +0000)
commite21defbbc4e6564c67d0defc2f55ddfb5879b790
tree0306e316cf20500b5a5e3bd8c2b21c3b2a70788d
parent0590114efbfd8070e23c8d247672f2d27032ecf0
tree-wide: Fix constness issues with newer glibc

Latest glibc uses _Generic to have strstr() and other functions return
const char* or char* based on whether the input is a const char* or a
char*. This causes build failures as we previously always expected a char*.

Let's fix the compilation failures and add our own macros similar to glibc's
to have string functions that return a mutable or const pointer depending on
the input.

(cherry picked from commit 0bac1ed2422f15308414dd1e9d09812a966b0348)
(cherry picked from commit 1a2e23b88734ec4be3af2eca651ec75a56161c5f)
24 files changed:
src/basic/proc-cmdline.c
src/basic/socket-util.c
src/basic/sort-util.h
src/basic/string-util.c
src/basic/string-util.h
src/basic/strv.c
src/basic/strv.h
src/basic/time-util.c
src/basic/unit-name.c
src/cryptsetup/cryptsetup-generator.c
src/fundamental/macro-fundamental.h
src/fundamental/string-util-fundamental.c
src/fundamental/string-util-fundamental.h
src/home/homed-manager.c
src/journal/journalctl-filter.c
src/libsystemd/sd-bus/sd-bus.c
src/libsystemd/sd-hwdb/sd-hwdb.c
src/libsystemd/sd-journal/catalog.c
src/network/networkd-dhcp-server.c
src/shared/bus-unit-util.c
src/shared/pager.c
src/shared/seccomp-util.c
src/shared/vpick.c
src/udev/udev-builtin-net_id.c