[gnutls-devel] libtasn1 | Use streq instead of strcmp (!125)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Mon Mar 30 03:25:03 CEST 2026



Daiki Ueno created a merge request: https://gitlab.com/gnutls/libtasn1/-/merge_requests/125

Project:Branches: dueno/libtasn1:wip/streq to gnutls/libtasn1:master
Author:   Daiki Ueno



Checking equality of strings with strcmp is error prone and Gnulib
provides streq function to avoid that. Switch to using it as well as
enable sc_prohibit_strcmp syntax check at build time.

The rewrite is mostly done with the following sed command:

```
  sed -i -e 's/!strcmp (\([^,]*\), \([^)]*\))/streq (\1, \2)/g' \
         -e 's/strcmp (\([^,]*\), \([^)]*\)) == 0/streq (\1, \2)/g' \
         -e 's/!(strcmp (\([^,]*\), \([^)]*\)))/streq (\1, \2)/g' \
         $(git grep -l -w strcmp lib/ src/)
```

## 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/125
You're receiving this email because of your account on gitlab.com. Unsubscribe from this thread: https://gitlab.com/-/sent_notifications/4-acvgusg61da15qlxlj1iyfyzy-aht8b/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/20260330/c3f3ea2e/attachment.html>


More information about the Gnutls-devel mailing list