Re: [PATCH 6/6] Use Arch instead of Debian for sr.ht builds

"Kevin J. McCarthy" <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <aZ2iLwtaV91rAL78@qinghai>
On Tue, Feb 24, 2026 at 01:41:26PM +0100, Rene Kita wrote:
>On Tue, Feb 24, 2026 at 07:23:26PM +0800, Kevin J. McCarthy wrote:
>
>This explains why it went so smooth with Arch. m-(
>
>Running the build on Arch I get multiple errors of this kind:
>browser.c:548:17: error: initialization discards 'const' qualifier from
>pointer target type [-Werror=discarded-qualifiers]
>  548 |       char *c = strrchr (d, '/');
>      |                 ^~~~~~~
>
>This is in function:
>static int examine_directory (MUTTMENU *menu, struct browser_state *state,
>			      const char *d, const char *prefix).
>
>AFAIU, strrchr is defined as: char * strrchr(const char *s, int c).
>
>*c is changed later in that function, so we can't make it const. Any
>ideas what's the best way forward from here?

Ah, that was my mistake from 7 years ago!  I changed the parameter type 
when I was converting to buffers and the compiler didn't flag anything, 
so I failed to notice d was sneakily being modified.

The "d" parameters buffers all come from the pool, so they won't be 
NULL.  I think the best thing to do is change the parameter type back to 
char *d and just directly pass the parameter->data.  But let me take a 
closer look tomorrow and fix it up.

-- 
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-----

iQIzBAEBCgAdFiEEiXWpszqjeRA4XFMIre92hIAxa9oFAmmdoi8ACgkQre92hIAx
a9qDbw//eLCF0IjfDvNw9c+IFhj+gS+gemzvIMIHkdVlDjAf6C5eMSkkV08fZb+Y
q4ppjJSiStl37dU6BflkuHooLnqiAtfmFHYWIjp/4NVHyD7x2g89dvAMpxRTdz0C
8fq3N317do17+8Ijn58qtWUqJL3JOkabJkZYMm7cpHnjXF3y7mjyx+UbrYqPSyVg
X56+rBeUL30pd0UfZHDpwqCiEkapWj9VQSKqkTASU7KAGtDW9XnxxaWz0STPuvES
1Y1YCpqTYw4FgOFQ1WW3yW7XLK6f5rriAKj81FLLFQsCw9FAlxOrvReypwDckjT4
o0HX036joYkuFq1SF8xUORHh0wewfhsEphTYv8OyZBDxbbaMLz7JTCAJHgTn+czp
bD36+3gkMd9ALEe7oommHHtByyMmykVU33skXkpeGY89WEqOU15A9LINGjX5LEZF
5HUgCuqkCiHUzPj7bVmb0MBT9H/l30zs3m5RsW3HnbIZMCqsZsmrcF4vTwmBYlht
f0xhkSAXMuqSxhAtLwtGIz/ClvZSTSKbA6aavepYwtIg44PNdXhNmEEXwDbSl185
uIoqY2oNozAcpUy4+tGxbGhjWkF5coadOkwKtJHeEJfUjhTILZqHFUI3PQEkRgEs
LHgUSuVp69kKA/3PfguteaXF8V0M6ipSRqzk9IILCccEAbj6ifk=
=wFVb
-----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.