Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ Checks: >
-objc-*,
-openmp-*,
-zircon-*,
cert-err34-c,
cppcoreguidelines-pro-type-static-cast-downcast,
cppcoreguidelines-rvalue-reference-param-not-moved,
google-explicit-constructor,
-bugprone-assignment-in-if-condition,
-bugprone-branch-clone,
-bugprone-command-processor,
-bugprone-easily-swappable-parameters,
-bugprone-empty-catch,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-signed-char-misuse,
-bugprone-switch-missing-default-case,
-bugprone-throwing-static-initialization,
-bugprone-unchecked-optional-access,
-clang-analyzer-*,
-concurrency-mt-unsafe,
Expand Down Expand Up @@ -69,9 +70,11 @@ Checks: >
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-redundant-parentheses,
-readability-suspicious-call-argument,
-readability-uppercase-literal-suffix,
-readability-use-concise-preprocessor-directives
-readability-use-concise-preprocessor-directives,
-misc-unconventional-assign-operator
WarningsAsErrors: '*'
HeaderFilterRegex: '(cli|gui|frontend|lib|oss-fuzz|test|triage)\/[a-z_]+\.h'
ExcludeHeaderFilterRegex: 'ui_.*.h'
Expand All @@ -82,3 +85,5 @@ CheckOptions:
value: '0'
- key: modernize-use-trailing-return-type.TransformFunctions
value: false
- key: misc-override-with-different-visibility.DisallowedVisibilityChange
value: widening
6 changes: 3 additions & 3 deletions .github/workflows/asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21
sudo ./llvm.sh 22

- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v4
Expand All @@ -76,8 +76,8 @@ jobs:
run: |
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_ADDRESS=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
env:
CC: clang-21
CXX: clang++-21
CC: clang-22
CXX: clang++-22

- name: Build cppcheck
run: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ jobs:
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21
sudo apt-get install -y clang-tidy-21
sudo ./llvm.sh 22
sudo apt-get install -y clang-tidy-22

- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v4
Expand All @@ -57,14 +57,14 @@ jobs:

- name: Verify clang-tidy configuration
run: |
clang-tidy-21 --verify-config
clang-tidy-22 --verify-config

- name: Prepare CMake
run: |
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off -DWARNINGS_ARE_ERRORS=On
env:
CC: clang-21
CXX: clang++-21
CC: clang-22
CXX: clang++-22

- name: Prepare CMake dependencies
run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ jobs:
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21
sudo apt-get install -y clang-tools-21
sudo ./llvm.sh 22
sudo apt-get install -y clang-tools-22

- name: Install libc++
if: matrix.stdlib == 'libc++'
run: |
sudo apt-get install -y libc++-21-dev
sudo apt-get install -y libc++-22-dev

- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v4
Expand All @@ -235,8 +235,8 @@ jobs:
run: |
cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off -DEXTERNALS_AS_SYSTEM=On -DUSE_LIBCXX=${{ matrix.use_libcxx }}
env:
CC: clang-21
CXX: clang++-21
CC: clang-22
CXX: clang++-22

- name: Prepare CMake dependencies
run: |
Expand All @@ -253,7 +253,7 @@ jobs:
- name: clang-include-cleaner
run: |
# TODO: run multi-threaded
find $PWD/cli $PWD/lib $PWD/test $PWD/gui -maxdepth 1 -name "*.cpp" | xargs -t -n 1 clang-include-cleaner-21 --print=changes --extra-arg=-w --extra-arg=-stdlib=${{ matrix.stdlib }} -p cmake.output > clang-include-cleaner.log 2>&1
find $PWD/cli $PWD/lib $PWD/test $PWD/gui -maxdepth 1 -name "*.cpp" | xargs -t -n 1 clang-include-cleaner-22 --print=changes --extra-arg=-w --extra-arg=-stdlib=${{ matrix.stdlib }} -p cmake.output > clang-include-cleaner.log 2>&1

- uses: actions/upload-artifact@v4
if: success() || failure()
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tsan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21
sudo ./llvm.sh 22

- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v4
Expand All @@ -75,8 +75,8 @@ jobs:
run: |
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_THREAD=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=Off -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
env:
CC: clang-21
CXX: clang++-21
CC: clang-22
CXX: clang++-22

- name: Build cppcheck
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ubsan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21
sudo ./llvm.sh 22

- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v4
Expand All @@ -75,8 +75,8 @@ jobs:
run: |
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_UNDEFINED=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
env:
CC: clang-21
CXX: clang++-21
CC: clang-22
CXX: clang++-22

- name: Build cppcheck
run: |
Expand Down
7 changes: 7 additions & 0 deletions clang-tidy.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ Does not improve the readability.
`modernize-use-designated-initializers`<br/>
`readability-enum-initial-value`<br/>
`modernize-use-trailing-return-type`<br/>
`misc-unconventional-assign-operator`<br/>
`bugprone-throwing-static-initialization`<br/>
`bugprone-command-processor`<br/>

To be evaluated (need to remove exclusion).

Expand All @@ -156,6 +159,10 @@ These apply to codebases which use later standards then C++11 (C++17 is used whe

We are not interested in this.

`readability-redundant-parentheses`<br/>

Reports false positives - see https://github.com/llvm/llvm-project/issues/164125.

### Disabled for performance reasons

`portability-std-allocator-const`<br/>
Expand Down
4 changes: 2 additions & 2 deletions cli/signalhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static void CppcheckSignalHandler(int signo, siginfo_t * info, void * context)
}
fprintf(output, " (at 0x%lx).%s\n",
reinterpret_cast<unsigned long>(info->si_addr),
(isAddressOnStack)?" Stackoverflow?":"");
isAddressOnStack ? " Stackoverflow?" : "");
break;
case SIGINT:
unexpectedSignal=false; // legal usage: interrupt application via CTRL-C
Expand All @@ -264,7 +264,7 @@ static void CppcheckSignalHandler(int signo, siginfo_t * info, void * context)
(type==-1)? "" :
(type==0) ? "reading " : "writing ",
reinterpret_cast<unsigned long>(info->si_addr),
(isAddressOnStack)?" Stackoverflow?":""
isAddressOnStack ? " Stackoverflow?" : ""
);
break;
case SIGUSR1:
Expand Down
10 changes: 6 additions & 4 deletions cmake/clang_tidy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if(NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
message(STATUS "Cannot use non-Clang compiler with clang-tidy when precompiled headers are enabled - skipping 'run-clang-tidy'/'run-clang-tidy-csa' target generation")
endif()
else()
set(RUN_CLANG_TIDY_NAMES run-clang-tidy run-clang-tidy-21 run-clang-tidy-20 run-clang-tidy-19 run-clang-tidy-18 run-clang-tidy-17 run-clang-tidy-16 run-clang-tidy-15 run-clang-tidy-14 run-clang-tidy-13 run-clang-tidy-12 run-clang-tidy-11 run-clang-tidy-10 run-clang-tidy-9 run-clang-tidy-8)
set(RUN_CLANG_TIDY_NAMES run-clang-tidy run-clang-tidy-22 run-clang-tidy-21 run-clang-tidy-20 run-clang-tidy-19 run-clang-tidy-18 run-clang-tidy-17 run-clang-tidy-16 run-clang-tidy-15 run-clang-tidy-14 run-clang-tidy-13 run-clang-tidy-12 run-clang-tidy-11 run-clang-tidy-10 run-clang-tidy-9 run-clang-tidy-8)
endif()

if(RUN_CLANG_TIDY_NAMES)
Expand All @@ -25,6 +25,9 @@ if(RUN_CLANG_TIDY_NAMES)
endif()
message(STATUS "NPROC=${NPROC}")

# TODO: introduced in run-clang-tidy-22
set(CLANG_TIDY_CONFIG "-enable-check-profile")

Comment on lines +28 to +30
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow this is not displayed in the CI. I cannot reproduce the issue locally.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check-profile data is printed to stderr, maybe CI only dump stdout?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works fine in danmar/simplecpp#514 but that calls it from the shell and not via CMake. I was getting the output when testing it locally but I only used a subset of all files so I suspect something might go awry when all are being scanned. I only had a short look at the run-clang-tidy.py wrapper and saw nothing suspicious.

On a side note - when there are warnings those might get mixed with the profiling output so it seems there might be some flushing missing in the wrapper after the analysis finished.

Copy link

@vbvictor vbvictor Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a side note - when there are warnings those might get mixed with the profiling output so it seems there might be some flushing missing in the wrapper after the analysis finished.

Stdout is explicitly slushed, maybe we should flush stderr too.

UPD: But if we print to stderr, then there is nothing to mix..?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPD: But if we print to stderr, then there is nothing to mix..?

No idea. I Need to reproduce it locally. There's just too many things to look into so I didn't get around to it yet.

# most of these are disabled because they are too noisy in our code
# clang-analyzer-core.CallAndMessage
# clang-analyzer-core.NonNullParamChecker
Expand All @@ -41,13 +44,12 @@ if(RUN_CLANG_TIDY_NAMES)

# TODO: exclude moc_*.cpp
# TODO: exclude mocs_compilation.cpp
# disable all compiler warnings since we are just interested in the tidy ones
add_custom_target(run-clang-tidy
${Python_EXECUTABLE} ${RUN_CLANG_TIDY} -p=${CMAKE_BINARY_DIR} -j ${NPROC} -quiet
${Python_EXECUTABLE} ${RUN_CLANG_TIDY} -p=${CMAKE_BINARY_DIR} -j ${NPROC} -quiet ${CLANG_TIDY_CONFIG}
USES_TERMINAL
VERBATIM)
add_custom_target(run-clang-tidy-csa
${Python_EXECUTABLE} ${RUN_CLANG_TIDY} -p=${CMAKE_BINARY_DIR} -j ${NPROC} -quiet ${CLANG_TIDY_CSA_ALPHA_OPTS} ${CLANG_TIDY_CSA_CONFIG}
${Python_EXECUTABLE} ${RUN_CLANG_TIDY} -p=${CMAKE_BINARY_DIR} -j ${NPROC} -quiet ${CLANG_TIDY_CONFIG} ${CLANG_TIDY_CSA_ALPHA_OPTS} ${CLANG_TIDY_CSA_CONFIG}
USES_TERMINAL
VERBATIM)
if(BUILD_GUI)
Expand Down
12 changes: 6 additions & 6 deletions gui/checkthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ class CheckThread : public QThread {
mSuppressionsUi = s;
}

/**
* @brief method that is run in a thread
*
*/
void run() override;

void stop();

/**
Expand Down Expand Up @@ -137,6 +131,12 @@ class CheckThread : public QThread {
std::shared_ptr<Suppressions> mSuppressions;

private:
/**
* @brief method that is run in a thread
*
*/
void run() override;

void runAddonsAndTools(const Settings& settings, const FileSettings *fileSettings, const QString &fileName);

void parseClangErrors(const QString &tool, const QString &file0, QString err);
Expand Down
1 change: 1 addition & 0 deletions gui/codeeditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class CodeEditor : public QPlainTextEdit {
return mFileName;
}

// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method) - TODO: fix this
void clear() {
mFileName.clear();
setPlainText(QString());
Expand Down
4 changes: 2 additions & 2 deletions gui/resultstree.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ class ResultsTree : public QTreeView {
*/
ShowTypes mShowSeverities;

void keyPressEvent(QKeyEvent *event) override;

void setReportType(ReportType reportType);

/**
Expand Down Expand Up @@ -557,6 +555,8 @@ protected slots:
bool mVisibleErrors{};

private:
void keyPressEvent(QKeyEvent *event) override;

/** tag selected items */
void tagSelectedItems(const QString &tag);

Expand Down
2 changes: 1 addition & 1 deletion gui/translationhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct TranslationInfo {
* track which translation is the currently active translation.
*
*/
class TranslationHandler : QObject {
class TranslationHandler : public QObject {
Q_OBJECT
public:
explicit TranslationHandler(QObject *parent = nullptr);
Expand Down
2 changes: 1 addition & 1 deletion lib/checkautovariables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ void CheckAutoVariables::autoVariables()
for (const ValueFlow::Value &v : tok->values()) {
if (v.isImpossible())
continue;
if ((v.isTokValue() && (isArrayVar(v.tokvalue) || ((v.tokvalue->tokType() == Token::eString)))) ||
if ((v.isTokValue() && (isArrayVar(v.tokvalue) || (v.tokvalue->tokType() == Token::eString))) ||
(v.isLocalLifetimeValue() && v.lifetimeKind == ValueFlow::Value::LifetimeKind::Address && !Token::simpleMatch(v.tokvalue, "("))) {
errorInvalidDeallocation(tok, &v);
break;
Expand Down
4 changes: 2 additions & 2 deletions lib/checkbufferoverrun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ static int getMinFormatStringOutputLength(const std::vector<const Token*> &param
outputStringSize++;

if (handleNextParameter) {
// NOLINTNEXTLINE(cert-err34-c) - intentional use
// NOLINTNEXTLINE(bugprone-unchecked-string-to-number-conversion) - intentional use
int tempDigits = std::abs(std::atoi(digits_string.c_str()));
if (i_d_x_f_found)
tempDigits = std::max(tempDigits, 1);

if (digits_string.find('.') != std::string::npos) {
const std::string endStr = digits_string.substr(digits_string.find('.') + 1);
// NOLINTNEXTLINE(cert-err34-c) - intentional use
// NOLINTNEXTLINE(bugprone-unchecked-string-to-number-conversion) - intentional use
const int maxLen = std::max(std::abs(std::atoi(endStr.c_str())), 1);

if (formatString[i] == 's') {
Expand Down
4 changes: 2 additions & 2 deletions lib/checkclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3188,9 +3188,9 @@ enum class CtorType : std::uint8_t {

void CheckClass::checkCopyCtorAndEqOperator()
{
// This is disabled because of #8388
// TODO: This is disabled because of #8388
// The message must be clarified. How is the behaviour different?
if ((true) || !mSettings->severity.isEnabled(Severity::warning)) // NOLINT(readability-simplify-boolean-expr)
if ((true) || !mSettings->severity.isEnabled(Severity::warning)) // NOLINT(readability-simplify-boolean-expr,readability-redundant-parentheses)
return;

// logChecker
Expand Down
16 changes: 8 additions & 8 deletions lib/checkcondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ static bool parseComparison(const Token *comp, bool &not1, std::string &op, std:
{
not1 = false;
while (comp && comp->str() == "!") {
not1 = !(not1);
not1 = !not1;
comp = comp->astOperand1();
}

Expand Down Expand Up @@ -1096,7 +1096,7 @@ static bool parseComparison(const Token *comp, bool &not1, std::string &op, std:
expr = comp;
}

inconclusive = inconclusive || ((value)[0] == '\'' && !(op == "!=" || op == "=="));
inconclusive = inconclusive || (value[0] == '\'' && !(op == "!=" || op == "=="));

// Only float and int values are currently handled
return MathLib::isInt(value) || MathLib::isFloat(value) || (value[0] == '\'');
Expand Down Expand Up @@ -1288,13 +1288,13 @@ void CheckCondition::checkIncorrectLogicOperator()
continue;

// the expr are not the token of the value but they provide better context
const double d1 = (isfloat) ? MathLib::toDoubleNumber(value1) : 0;
const double d2 = (isfloat) ? MathLib::toDoubleNumber(value2) : 0;
const MathLib::bigint i1 = (isfloat) ? 0 : MathLib::toBigNumber(value1, expr1);
const MathLib::bigint i2 = (isfloat) ? 0 : MathLib::toBigNumber(value2, expr2);
const double d1 = isfloat ? MathLib::toDoubleNumber(value1) : 0;
const double d2 = isfloat ? MathLib::toDoubleNumber(value2) : 0;
const MathLib::bigint i1 = isfloat ? 0 : MathLib::toBigNumber(value1, expr1);
const MathLib::bigint i2 = isfloat ? 0 : MathLib::toBigNumber(value2, expr2);
const bool useUnsignedInt = (std::numeric_limits<MathLib::bigint>::max()==i1) || (std::numeric_limits<MathLib::bigint>::max()==i2);
const MathLib::biguint u1 = (useUnsignedInt) ? MathLib::toBigUNumber(value1, expr1) : 0;
const MathLib::biguint u2 = (useUnsignedInt) ? MathLib::toBigUNumber(value2, expr2) : 0;
const MathLib::biguint u1 = useUnsignedInt ? MathLib::toBigUNumber(value1, expr1) : 0;
const MathLib::biguint u2 = useUnsignedInt ? MathLib::toBigUNumber(value2, expr2) : 0;
// evaluate if expression is always true/false
bool alwaysTrue = true, alwaysFalse = true;
bool firstTrue = true, secondTrue = true;
Expand Down
2 changes: 1 addition & 1 deletion lib/checkio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1681,7 +1681,7 @@ bool CheckIO::ArgumentInfo::isArrayOrPointer() const
bool CheckIO::ArgumentInfo::isComplexType() const
{
if (variableInfo->type())
return (true);
return true;

const Token* varTypeTok = typeToken;
if (varTypeTok->str() == "std")
Expand Down
2 changes: 1 addition & 1 deletion lib/checkmemoryleak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ void CheckMemoryLeakInFunction::checkReallocUsage()
continue;

const AllocType allocType = getReallocationType(reallocTok, tok->varId());
if (!((allocType == Malloc || allocType == OtherMem)))
if (!(allocType == Malloc || allocType == OtherMem))
continue;
const Token* arg = getArguments(reallocTok).at(f->reallocArg - 1);
while (arg && arg->isCast())
Expand Down
Loading
Loading