ofono: Fix issue with const return value from strrchr
PATCH 5/5 ofono: 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/ofono.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
plugins/ofono.c +2 -2
@@ -186,9 +186,9 @@ static const char *api2string(enum ofono_api api)return "unknown" ; } -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