3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2026-02-15 02:27:56 +01:00
iwd/client
Marcel Holtmann a0751085a8 client: Fix issue with const return value from strrchr
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>
2026-02-10 17:37:09 +01:00
..
2022-07-07 14:09:03 -05:00
2024-01-04 12:18:40 -06:00
2024-08-12 12:10:58 -05:00
2022-03-18 11:31:48 -05:00
2021-01-25 10:46:07 -06:00
2024-11-07 19:11:59 +01:00
2020-01-27 09:47:40 -06:00