Re: [PATCH] Fix const warnings on Arch linux with the latest glibc.

"Kevin J. McCarthy" <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <aZ7lFVGyyFkksRCJ@qinghai>
On Wed, Feb 25, 2026 at 12:07:03PM +0100, Alejandro Colomar wrote:
>> diff --git a/parse.c b/parse.c
>> index 141947f4..c46a5811 100644
>> --- a/parse.c
>> +++ b/parse.c
>[...]
>> @@ -1001,7 +1001,8 @@ time_t mutt_parse_date (const char *s, HEADER *h)
>>          {
>>            struct tz_t *tz;
>>
>> -          tz = bsearch (ptz, TimeZones, sizeof TimeZones/sizeof (struct tz_t),
>> +          tz = (struct tz_t *)bsearch (ptz, TimeZones,
>> +                        sizeof TimeZones/sizeof (struct tz_t),
>>                          sizeof (struct tz_t),
>>                          (int (*)(const void *, const void *)) ascii_strcasecmp
>>                          /* This is safe to do: A pointer to a struct equals
>
>But, why do we need to cast here?

Oh, for this one I'm not sure.  It was in the patch Rene sent out 
initially, so I just included it.  Rene, can you confirm the need for 
the cast?

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEiXWpszqjeRA4XFMIre92hIAxa9oFAmme5RUACgkQre92hIAx
a9qi5w/8DGgHN6tH9rdq+bX93BsZISBfUqDU55OGtieGiboet6nN+0xgCsr6poM/
+bmuHi0LBEwIMfLn06JFhgTi8ZdjRrLEYGeBYcA4NOHn93ea/TF2+pCT/RohbvgI
euJi5xcRHKGubxcaskqS6blys3IZG5ksju38UUPazl9bP4KHY/tBzCKieyZeJeBA
he6ahkDM2f91covUs/+qyPzthvD5gGovRzgoKp6eptBpHEbUL93yWTvNRbynq17S
R2qjmJeOuIa44E59UtpfHiyIwhn8LMF46yxOpaLgSJZEmEqzmWaMUXY+SjjmY36F
saGeq+Dnsixk+gZ51giJGNxvYppEV0X/RnVBEYcRkXCoccBORO2cYcYW0u9PpOXD
t+XImy9RZ8qR1tWKMSWW5jkStjlVLjiZQ9Xby9JJCFKhEPOdDkTGleHW+SPt+0+c
6R2WVs6EcKmr8YxZTUWynSS8RpLZC3f96JQkNWxxFaNwblDY0NoM71OEoYGDZ9G3
b8CREopP9YWaDVxl5yLsvcv/7WNRE66yfSg11Dtf0XlzNGNKGT2CinuYJLobbxiN
CI1U9Y0vy3WZbVfTqVRLizYHGKihZx2C6x0wXMxVivrMjZEgq7vLwsnk35+SvXfJ
eqDLeEIDz2Ini1GTiz93Z3haCXXFmmjBsoBAZeVvDJylMH4tKoo=
=X15q
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.