From: Karel Zak Date: Thu, 27 Nov 2025 15:33:04 +0000 (+0100) Subject: dmesg: fix const qualifier warnings in parse_callerid X-Git-Tag: v2.41.3~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3469a96896018df229b91c8946b43cb6b4025ad6;p=thirdparty%2Futil-linux.git dmesg: fix const qualifier warnings in parse_callerid Fix const qualifier discarded warnings in parse_callerid(). 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 (cherry picked from commit 40e6850d2b2ba2492d5f3e75656cb9bcce2806bb) --- diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index cccbd4067..cdf23b021 100644 --- a/sys-utils/dmesg.c +++ b/sys-utils/dmesg.c @@ -844,8 +844,7 @@ static const char *parse_callerid(const char *p_str, const char *end, const char *p_after; const char *p_next; size_t cid_size; - char *p_scn; - char *p_cid; + const char *p_scn, *p_cid; /* Check for PRINTK_CALLER prefix, must be before msg text */ p_cid = strstr(p_str, DMESG_CALLER_PREFIX);