clang-tools 22.0.0git
clang::tidy::android::CloexecAccept4Check Class Reference

Finds code that uses accept4() without using the SOCK_CLOEXEC flag. More...

#include <CloexecAccept4Check.h>

Inheritance diagram for clang::tidy::android::CloexecAccept4Check:
[legend]

Public Member Functions

 CloexecAccept4Check (StringRef Name, ClangTidyContext *Context)
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override
Public Member Functions inherited from clang::tidy::android::CloexecCheck
 CloexecCheck (StringRef Name, ClangTidyContext *Context)

Additional Inherited Members

Protected Member Functions inherited from clang::tidy::android::CloexecCheck
void registerMatchersImpl (ast_matchers::MatchFinder *Finder, ast_matchers::internal::Matcher< FunctionDecl > Function)
void insertMacroFlag (const ast_matchers::MatchFinder::MatchResult &Result, StringRef MacroFlag, int ArgPos)
 Currently, we have three types of fixes.
void replaceFunc (const ast_matchers::MatchFinder::MatchResult &Result, StringRef WarningMsg, StringRef FixMsg)
 Type2 is to replace the API to another function that has required the ability.
void insertStringFlag (const ast_matchers::MatchFinder::MatchResult &Result, const char Mode, const int ArgPos)
 Type3 is also to add a flag to the corresponding argument, but this time, the flag is some string and each char represents a mode rather than a macro.
StringRef getSpellingArg (const ast_matchers::MatchFinder::MatchResult &Result, int N) const
 Helper function to get the spelling of a particular argument.
Static Protected Attributes inherited from clang::tidy::android::CloexecCheck
static const char * FuncDeclBindingStr = "funcDecl"
 Binding name of the FuncDecl of a function call.
static const char * FuncBindingStr = "func"
 Binding name of the function call expression.

Detailed Description

Finds code that uses accept4() without using the SOCK_CLOEXEC flag.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/android/cloexec-accept4.html

Definition at line 20 of file CloexecAccept4Check.h.

Constructor & Destructor Documentation

◆ CloexecAccept4Check()

clang::tidy::android::CloexecAccept4Check::CloexecAccept4Check ( StringRef Name,
ClangTidyContext * Context )
inline

Member Function Documentation

◆ check()

void clang::tidy::android::CloexecAccept4Check::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

◆ registerMatchers()

void clang::tidy::android::CloexecAccept4Check::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

The documentation for this class was generated from the following files: