From dbe4c16973d5d0f69ba3bf1bd8942a51de9a0933 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 27 Nov 2025 15:41:21 +0100 Subject: [PATCH] lsns: fix const qualifier warnings for C23 Fix const qualifier discarded warnings in read_persistent_namespaces() and is_path_included() functions. These warnings are reported by gcc 15 which defaults to the C23 standard. The strchr() and strstr() functions return pointers into const strings, so the receiving variables must be declared as const char *. Signed-off-by: Karel Zak --- sys-utils/lsns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c index 2e887e802..2b7337777 100644 --- a/sys-utils/lsns.c +++ b/sys-utils/lsns.c @@ -1030,8 +1030,8 @@ static int read_persistent_namespaces(struct lsns *ls) struct libmnt_fs *fs = NULL; while (mnt_table_next_fs(ls->tab, itr, &fs) == 0) { - const char *root; - char *p, *end = NULL; + const char *root, *p; + char *end = NULL; ino_t ino; int fd; @@ -1126,7 +1126,7 @@ static int is_path_included(const char *path_set, const char *elt, { size_t elt_len; size_t path_set_len; - char *tmp; + const char *tmp; tmp = strstr(path_set, elt); -- 2.47.3