Re: Minor cleanup after adding more warnings to CFLAGS
"Kevin J. McCarthy" <[email protected]>
| Newsgroups | gmane.mail.mutt.devel |
|---|---|
| Message-ID | <aeBrIdb9AfVxgC9Z@qinghai> |
On Thu, Apr 16, 2026 at 06:25:27AM +0200, Rene Kita wrote: >On Thu, Apr 16, 2026 at 09:16:52AM +0800, Kevin J. McCarthy wrote: >> I'd be interested if we could get a little further along to safety by >> adopting the same mechanism glibc recently did for strchr and the others. I >> haven't looked into what dark arts were involved. > >Do you have some pointer for me to where I can get more infos about >those changes in glibc? I haven't looked into this previously, but a little Googling turned up <https://en.wikipedia.org/wiki/C23_(C_standard_revision)> and specifically reference #57 next to "Make the functions bsearch(), bsearch_s(), memchr(), strchr(), strpbrk(), strrchr(), strstr(), and their wide counterparts wmemchr(), wcschr(), wcspbrk(), wcsrchr(), wcsstr() return a const qualified object if one was passed to them." So... I guess this is C23. Which I know almost nothing about :-D. In any case, we're a long ways away from getting to that level of C standard support in Mutt. So the only other alternative might be something like the other approach of a "const char *" function and a "char *" wrapper. I don't insist on that though; it was just brainstorming. -- 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----- iQIzBAEBCgAdFiEEiXWpszqjeRA4XFMIre92hIAxa9oFAmngayEACgkQre92hIAx a9qGnxAAtyc9lK3veL4JoEkyxEgKsEsSp3+ETTztenj9FiBkqDmnsX7Nw1Q7tv+g YNXpquONuMW876zPm+TRycfol01UHOE1/MVkys4fsTWFX65Gn7E+PMgjGKLtEpxs NZyLA1TTk5tcCT/dARJgbHk/9Y7y4Z86jN+lkLMDGBg8f4N4ybmbaFE75wMvv4+V N2r5OlUwjJSSctxRYsw05d/AgsGOYveLpQF60K7+psr+yHkC3yiJ9gaABWHQNYEA YEc2C4UWNCyMkTLAgiUeXCRGJQfclePa5zLQrlwKMJpeH9XGi+qseOWaj+40S1mB eei0Y13Yf+6h01b4KZs1PDUX9pXtZh2DwBZumo8g+IOHidftTTPK01LNkapbcfyE /bT8L1wpeCuk3OMEedJvVtV5h3nFrcZMFOjNKvK+chx8Q20bjDVsDa5NxIVmJaUl 934Jt0BmAoHQnY9MaMIhTo7SpIVfyyLul8CC7mvi4ng7pa6F/OBpAor+yEX7yLE9 x3GFiqyP7y3goIkpUEI9B/ppNeQBvi/jjIzAeoiunct3mXF/SpkdGKel+kOVwvBg C6e+mzS73r/A85Nl/+2eEdS2Xl1VpeeQbWRLioce22mlQKp0kw0+68HUctp1HkK9 qz6phTZ1FkhxH72haK7AfbJqUvRU5MOeMMh9iCnaK5VRqWEDL0I= =UOc7 -----END PGP SIGNATURE-----