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

Alejandro Colomar via Mutt-dev <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <aZ2j9qAEsSVfBggG@devuan>
Hi Kevin,

On 2026-02-24T21:05:51+0800, Kevin J. McCarthy wrote:
> 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.

Indeed; I find working with bare strings much easier.  Buffers seem
safer in theory, but end up having corner cases that are uglier than
strings themselves.

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

See the other emails I've sent; they might help.


Have a lovely day!
Alex

> 
> -- 
> Kevin J. McCarthy
> GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA



-- 
<https://www.alejandro-colomar.es>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmmdpIYACgkQ64mZXMKQ
wqk8YRAAqLaVCuMYAct42qeiejXGAPt2Zup3HwYl0R1ZZj8LizkGtllISLN369Z2
TLCtQCgP2vNMU1lgH+rX0t/0f6WDO5ojKi6IWdMLGrbjswE0gqyesNVRSDLl33N6
C/1FYTzKmrgZbn9kMMSf9AVmE3ESMuKhWC/6DOB0rNHKI2O4s/uJfhU97VyTksv8
H8cOAF60OLhgi+zb+xLdI5Q0qc5kf+uYx+grlPjy9/LOUB+P2ZtiRNJIJcU2CQo9
vz0rRXcck5g6QlLts0/vNPK2AKm8SWl9Kz5Y7VUibGp0uFQzEpEaKRDO3BatOHnL
WE6FOOvDkhQX4m7Jkmurxhnda4nbk+lCY+krRqRBqn0Qlhem9YCerm5AKjFNLkiD
84Y/vKpdvQ6uYh/f5nANo3gcsnbbtx1/m1Vys892MLOfE1nxo2kjRhNropYCkeoR
xSgEEIGamLZrdCFgVBLxcZ/Sl1hlieTlIaXzHn+r7FoDSAF0slB8G/MVN3diLlv6
805ZjMDLBwsfaYTT5FaVK0bSnUGbwLe1Fc1SPsUGTCGExsb5N6EmPTUYmEtqIs5+
KgT0NwYB3NXLJt5ymFiP2miJH0+Z9KXLja+QZeeH8GNkk7qVZFeILQeXulEKShab
UGOaixY1obWp/nfMoXXCobBHIicBTM4j8Xh12b5Ue/+izoVatUQ=
=bNbv
-----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.