[PATCH 4/5] dundee: Fix issue with const return value from strrchr

Rudi Heitbaum <[email protected]> Thu, 12 Feb 2026 13:27:26 +0000
Newsgroups dev.linux.lists.connman
Message-ID <aY3VPvVuJVv9ZTyJ@01676446e9f4>
When compiling with recent gcc and glibc-2.43 the --Wdiscarded-qualifiers
warning occurs because with ISO C23, the function strrrchr 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.
---
 plugins/dundee.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/dundee.c b/plugins/dundee.c
index 57571ec3..7716ec60 100644
--- a/plugins/dundee.c
+++ b/plugins/dundee.c
@@ -73,9 +73,9 @@ struct dundee_data {
 	DBusPendingCall *call;
 };
 
-static char *get_ident(const char *path)
+static const char *get_ident(const char *path)
 {
-	char *pos;
+	const char *pos;
 
 	if (*path != '/')
 		return NULL;
-- 
2.51.0