From: Karel Zak Date: Thu, 27 Nov 2025 15:48:53 +0000 (+0100) Subject: partx: fix const qualifier warning in get_max_partno X-Git-Tag: v2.41.3~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8aaf7e2ea5f4ff6b8c9890f40f71a95eb3fcfb11;p=thirdparty%2Futil-linux.git partx: fix const qualifier warning in get_max_partno Fix const qualifier discarded warning in get_max_partno(). 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 (cherry picked from commit 4c94ce5d05d97420df7a512bbbaee8c4017414ae) --- diff --git a/disk-utils/partx.c b/disk-utils/partx.c index 347d5daad..a2df5d4c0 100644 --- a/disk-utils/partx.c +++ b/disk-utils/partx.c @@ -218,7 +218,8 @@ err: static int get_max_partno(const char *disk, dev_t devno) { - char path[PATH_MAX], *parent, *dirname = NULL; + char path[PATH_MAX], *dirname = NULL; + const char *parent; struct stat st; DIR *dir; struct dirent *d;