mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2026-02-15 02:27:56 +01:00
When compiling iwd 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.
client/known-networks.c: In function 'known_network_proxy_find_by_name':
client/known-networks.c:296:29: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
296 | char *dot = strrchr(name, '.');
| ^~~~~~~
The warning hints to real bug since *dot should not be modified since
*name is actually const to begin with. Change the code to utilize a copy
of the name value if needed.
Reported-by: Rudi Heitbaum <rudi@heitbaum.com>