Since glibc-2.43:
For 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:
tests/modetest/modetest.c: In function 'parse_connector':
tests/modetest/modetest.c:1997:22: warning: assignment discards 'const'
qualifier from pointer target type [-Wdiscarded-qualifiers]
1997 | endp = strpbrk(p, ",@:");
| ^
Signed-off-by: Rudi Heitbaum <[email protected]>
---
tests/modetest/modetest.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index 24c0e2dc..3c0a8803 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -1974,7 +1974,8 @@ static int parse_connector(struct pipe_arg *pipe, const
char *arg)
unsigned int len;
unsigned int i;
const char *p;
- char *endp;
+ const char *endp;
+ char *endp_tok;
pipe->vrefresh = 0;
pipe->crtc_id = (uint32_t)-1;
@@ -2012,7 +2013,8 @@ static int parse_connector(struct pipe_arg *pipe, const
char *arg)
return -1;
if (*endp == '@') {
arg = endp + 1;
- pipe->crtc_id = strtoul(arg, &endp, 10);
+ pipe->crtc_id = strtoul(arg, &endp_tok, 10);
+ endp = endp_tok;
}
if (*endp != ':')
return -1;
@@ -2028,8 +2030,8 @@ static int parse_connector(struct pipe_arg *pipe, const
char *arg)
pipe->mode_str[len] = '\0';
if (*p == '-') {
- pipe->vrefresh = strtof(p + 1, &endp);
- p = endp;
+ pipe->vrefresh = strtof(p + 1, &endp_tok);
+ p = endp_tok;
}
if (*p == '@') {
--
2.53.0