From 6d8fbbf84823c0a5b5cf1ffa73f18cc29acd54bb Mon Sep 17 00:00:00 2001 From: heitbaum Date: Mon, 9 Mar 2026 01:27:04 +0100 Subject: [PATCH] fix discard const qualifier from pointers Since glibc-2.43 and ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr, strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return pointers into their input arrays now have definitions as macros that return a pointer to a const-qualified type when the input argument is a pointer to a const-qualified type. Fixes: ../src/pv/display.c: In function 'pv__format_init': ../src/pv/display.c:715:37: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 715 | strchr(format_component_array[component_idx].match, (int) ':'); | ^~~~~~ --- src/pv/display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pv/display.c b/src/pv/display.c index 2c7a1ff..4b06dab 100644 --- a/src/pv/display.c +++ b/src/pv/display.c @@ -711,7 +711,7 @@ static void pv__format_init(pvprogramstatus_t status, readonly_pvcontrol_t contr component_type = -1; for (component_idx = 0; NULL != format_component_array[component_idx].match; component_idx++) { size_t component_sequence_length = strlen(format_component_array[component_idx].match); /* flawfinder: ignore */ - char *component_colon_pointer = + const char *component_colon_pointer = strchr(format_component_array[component_idx].match, (int) ':'); /* flawfinder - static strings, guaranteed null-terminated. */