[PATCH] D66627: [clang-tidy] new check: bugprone-pthread-return
Dmitri Gribenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 26 02:26:50 PDT 2019
gribozavr added a comment.
Thanks for the contribution! In abstract, I think it is a good checker, however, the implementation largely duplicates `clang-tidy/bugprone/PosixReturnCheck.cpp` -- do you think you could factor out the common parts? I see at least two ways:
- Factor out a library, use it in both checkers.
- Put everything into one checker, if necessary, add configuration options to turn on/off POSIX and PThread parts. However, I don't even think configuration options would be necessary -- it is unlikely that someone would want one but not the other -- or is there a use case?
================
Comment at: clang-tools-extra/test/clang-tidy/bugprone-pthread-return.cpp:101
+extern "C" int pthread_timedjoin_np(pthread_t thread, void **retval, const struct timespec *abstime);
+extern "C" int pthread_yield(void);
+
----------------
It does not seem like most of these functions are used in the test below. Could you leave only representative functions for each case in the code?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66627/new/
https://reviews.llvm.org/D66627
More information about the cfe-commits
mailing list