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) ':');
| ^~~~~~
This commit is contained in:
+1
-1
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user