libtasn1 | Fix discard const qualifier (!123)

Read-only notification of GnuTLS library development activities <[email protected]>
Newsgroups gmane.comp.encryption.gpg.gnutls.devel
Message-ID <[email protected]>

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

_______________________________________________
Gnutls-devel mailing list
[email protected]
http://lists.gnupg.org/mailman/listinfo/gnutls-devel
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.