Fix C std23 related warnings with new glibc.

C standard library functions now preserves qualifiers passed
to some functions. In case of strchr() if the passed argument is
const qualified also the returned value is const qualified. Similarly
if the passed argument is not const qualified neither is the return
value.

This patch makes libcryptsetup compliant with the change and should
be backward compatible with older std libraries.

Thanks Vojta Trefny for heads-up.
This commit is contained in:
Ondrej Kozina
2025-12-02 11:07:04 +01:00
parent f1ba606c28
commit a07c8a556c
5 changed files with 12 additions and 8 deletions

View File

@@ -3287,7 +3287,7 @@ int dm_is_dm_kernel_name(const char *name)
int dm_uuid_cmp(const char *dm_uuid, const char *hdr_uuid)
{
int i, j;
char *str;
const char *str;
if (!dm_uuid || !hdr_uuid)
return -EINVAL;
@@ -3322,7 +3322,7 @@ int dm_uuid_cmp(const char *dm_uuid, const char *hdr_uuid)
int dm_uuid_integrity_cmp(const char *dm_uuid, const char *dmi_uuid)
{
int i;
char *str, *stri;
const char *str, *stri;
if (!dm_uuid || !dmi_uuid)
return -EINVAL;