Skip to contentSkip to conversation

dundee: Fix issue with const return value from strrchr

PATCH Applied Rudi Heitbaum 1 participant 1 message Feb 12

lore
Share & tools
lore
#0 lore raw

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

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(-)
plugins/dundee.c +2 -2
index 57571ec3..7716ec60 100644
@@ -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;
Signature · 1 line
2.51.0