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-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c94ce5d05d97420df7a512bbbaee8c4017414ae;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 --- diff --git a/disk-utils/partx.c b/disk-utils/partx.c index f4affe972..bb1bdc268 100644 --- a/disk-utils/partx.c +++ b/disk-utils/partx.c @@ -219,7 +219,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;