[clang-tidy] Fix cert-err33-c to ignore functions with same prefixes as target (#135160)

PR #82952 introduced regex matching for `CheckedFunctions` in
`UnusedReturnValueCheck` which is used by the checker `cert-err33-c`.

Add a testcase and fix false positives by adding end-of-string to target
regex's.

---------

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
This commit is contained in:
Björn Svensson
2025-04-11 10:08:29 +02:00
committed by GitHub
parent aeb06c6152
commit 0276915a6c
3 changed files with 190 additions and 177 deletions

View File

@@ -151,6 +151,10 @@ Changes in existing checks
<clang-tidy/checks/bugprone/unsafe-functions>` check to allow specifying
additional C++ member functions to match.
- Improved :doc:`cert-err33-c
<clang-tidy/checks/cert/err33-c>` check by fixing false positives when
a function name is just prefixed with a targeted function name.
- Improved :doc:`misc-const-correctness
<clang-tidy/checks/misc/const-correctness>` check by adding the option
`AllowedTypes`, that excludes specified types from const-correctness