From: Karel Zak Date: Thu, 27 Nov 2025 15:44:47 +0000 (+0100) Subject: namei: fix const qualifier warning in readlink_to_namei X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e318417f00982bf496fd2359853b07ada3e3c544;p=thirdparty%2Futil-linux.git namei: fix const qualifier warning in readlink_to_namei Fix const qualifier discarded warning in readlink_to_namei(). This warning is reported by gcc 15 which defaults to the C23 standard. The strrchr() function returns a pointer into a const string, so the receiving variable must be declared as const char *. Signed-off-by: Karel Zak --- diff --git a/misc-utils/namei.c b/misc-utils/namei.c index 3bfe216e3..768ae00d7 100644 --- a/misc-utils/namei.c +++ b/misc-utils/namei.c @@ -100,7 +100,7 @@ readlink_to_namei(struct namei *nm, const char *path) if (sz < 1) err(EXIT_FAILURE, _("failed to read symlink: %s"), path); if (*sym != '/') { - char *p = strrchr(path, '/'); + const char *p = strrchr(path, '/'); if (p) { isrel = 1;