[gnutls-devel] libtasn1 | Fix discard const qualifier (!123)
Read-only notification of GnuTLS library development activities
gnutls-devel at lists.gnutls.org
Sun Feb 22 11:11:45 CET 2026
Rudi Heitbaum created a merge request: https://gitlab.com/gnutls/libtasn1/-/merge_requests/123
Project:Branches: rudi20/libtasn1:const to gnutls/libtasn1:master
Author: Rudi Heitbaum
## description
Since glibc-2.43 and ISO C23, the functions bsearch, memchr, strchr,
strpbrk, strrchr, strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr
that return pointers into their input arrays now have definitions as
macros that return a pointer to a const-qualified type when the input
argument is a pointer to a const-qualified type.
n_end pointer returns are only being used for comparisons so declare
them as const, which matches the input variable. n_start was already
declares as const, so matching logic.
Fixes:
```
../../../lib/minitasn1/parser_aux.c: In function 'asn1_find_node':
../../../lib/minitasn1/parser_aux.c:148:13: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qu
alifiers]
148 | n_end = strchr (n_start, '.'); /* search the first dot */
| ^
../../../lib/minitasn1/parser_aux.c:189:13: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qu
alifiers]
189 | n_end = strchr (n_start, '.'); /* search the next dot */
| ^
```
This PR is in addition to https://gitlab.com/gnutls/gnutls/-/merge_requests/2073
## Checklist
* [ ] Code modified for feature
* [ ] Test suite updated with functionality tests
* [ ] Test suite updated with negative tests
* [ ] Documentation updated
## Reviewer's checklist:
* [ ] There is a test suite reasonably covering new functionality or modifications
* [ ] Function naming, parameters, return values, types, etc., are consistent with other code
* [ ] This feature/change has adequate documentation added
* [ ] No obvious mistakes in the code
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/libtasn1/-/merge_requests/123
You're receiving this email because of your account on gitlab.com. Unsubscribe from this thread: https://gitlab.com/-/sent_notifications/3-8v4x1b8i5vuynl876ewe9r1u4/unsubscribe | Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20260222/12042757/attachment-0001.html>
More information about the Gnutls-devel
mailing list