[PATCH] D118370: [clang-tidy] bugprone-signal-handler: Message improvement and code refactoring.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 23 11:15:42 PST 2022


aaron.ballman added a comment.

Mostly small nits, but it looks like precommit CI is failing due to the changes:

  Failed Tests (2):
    Clang Tools :: clang-tidy/checkers/bugprone-signal-handler-minimal.c
    Clang Tools :: clang-tidy/checkers/bugprone-signal-handler-posix.c



================
Comment at: clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp:149
+    // No need to show a call chain.
+    // Without code body there is no more thing to check.
     return;
----------------



================
Comment at: clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp:173
+                                       const Expr *CallOrRef) {
+  const bool FunctionIsCalled = isa<CallExpr>(CallOrRef);
+
----------------



================
Comment at: clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp:188
+  if (!FD->hasBody()) {
+    diag(CallOrRef->getBeginLoc(), "can not verify if external function %0 is "
+                                   "asynchronous-safe; "
----------------



================
Comment at: clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.h:46
+  bool checkFunction(const FunctionDecl *FD, const Expr *CallOrRef);
+  /// Return if a system call function is considered as asynchronous-safe.
   bool isSystemCallAsyncSafe(const FunctionDecl *FD) const;
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118370/new/

https://reviews.llvm.org/D118370



More information about the cfe-commits mailing list