[clang-tidy] Do not flag strerror in concurrency-mt-unsafe (#140520)

The docs of the check state:

> Glibc’s list is compiled from GNU web documentation with a search for
MT-Safe tag

And strerror fulfills exactly that:
https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html

> Function: char * strerror (int errnum)
> Preliminary: | MT-Safe | AS-Unsafe heap i18n | AC-Unsafe mem | See
POSIX Safety Concepts.

So concurrency-mt-unsafe should not flag it.

Fixes #140515

---------

Co-authored-by: Carlos Gálvez <carlos.galvez@zenseact.com>
Co-authored-by: EugeneZelenko <eugene.zelenko@gmail.com>
This commit is contained in:
Carlos Galvez
2025-05-19 21:27:37 +02:00
committed by GitHub
parent 29fd76777d
commit 322d0197f5
3 changed files with 7 additions and 1 deletions

View File

@@ -172,6 +172,10 @@ Changes in existing checks
<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:`concurrency-mt-unsafe
<clang-tidy/checks/concurrency/mt-unsafe>` check by fixing a false positive
where ``strerror`` was flagged as MT-unsafe.
- Improved :doc:`misc-const-correctness
<clang-tidy/checks/misc/const-correctness>` check by adding the option
`AllowedTypes`, that excludes specified types from const-correctness