clang-tools 22.0.0git
clang::tidy::bugprone::SignedCharMisuseCheck Class Reference

Finds those signed char -> integer conversions which might indicate a / programming error. More...

#include <SignedCharMisuseCheck.h>

Inheritance diagram for clang::tidy::bugprone::SignedCharMisuseCheck:
[legend]

Public Member Functions

 SignedCharMisuseCheck (StringRef Name, ClangTidyContext *Context)
void storeOptions (ClangTidyOptions::OptionMap &Opts) override
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override

Detailed Description

Finds those signed char -> integer conversions which might indicate a / programming error.

The basic problem with the signed char, that it might store the non-ASCII characters as negative values. This behavior can cause a misunderstanding of the written code both when an explicit and when an implicit conversion happens.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/signed-char-misuse.html

Definition at line 24 of file SignedCharMisuseCheck.h.

Constructor & Destructor Documentation

◆ SignedCharMisuseCheck()

clang::tidy::bugprone::SignedCharMisuseCheck::SignedCharMisuseCheck ( StringRef Name,
ClangTidyContext * Context )

Definition at line 21 of file SignedCharMisuseCheck.cpp.

Member Function Documentation

◆ check()

void clang::tidy::bugprone::SignedCharMisuseCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

◆ registerMatchers()

void clang::tidy::bugprone::SignedCharMisuseCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 69 of file SignedCharMisuseCheck.cpp.

◆ storeOptions()

void clang::tidy::bugprone::SignedCharMisuseCheck::storeOptions ( ClangTidyOptions::OptionMap & Opts)
override

Definition at line 28 of file SignedCharMisuseCheck.cpp.


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