fixes warning since glibc-2.43

For ISO C23, the functions wcschr 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.

../../parted/strlist.c: In function 'wchar_strchr':
../../parted/strlist.c:61:16: warning: return discards 'const' qualifier from 
pointer target type [-Wdiscarded-qualifiers]
   61 |         return wcschr (str, ch);
      |                ^~~~~~

Signed-off-by: Rudi Heitbaum <[email protected]>
---
 parted/strlist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parted/strlist.c b/parted/strlist.c
index c4cb351..977bc07 100644
--- a/parted/strlist.c
+++ b/parted/strlist.c
@@ -54,7 +54,7 @@ wchar_strlen (const wchar_t* str)
 #endif
 }
 
-static wchar_t * _GL_ATTRIBUTE_PURE
+static const wchar_t * _GL_ATTRIBUTE_PURE
 wchar_strchr (const wchar_t* str, char ch)
 {
 #ifdef ENABLE_NLS
-- 
2.51.0




Reply via email to