Enable clang-tidy bugprone-assert-side-effect

Official docs:

  Finds assert() with side effect. The condition of assert() is
  evaluated only in debug builds so a condition with side effect can
  cause different behavior in debug / release builds.
This commit is contained in:
Robert Schulze 2022-05-08 07:35:17 +02:00
parent 9c51657821
commit 7d3913f350
No known key found for this signature in database
GPG Key ID: 26703B55FB13728A
2 changed files with 1 additions and 2 deletions

View File

@ -5,7 +5,6 @@ Checks: '*,
-android-*, -android-*,
-bugprone-assert-side-effect,
-bugprone-branch-clone, -bugprone-branch-clone,
-bugprone-dynamic-static-initializers, -bugprone-dynamic-static-initializers,
-bugprone-easily-swappable-parameters, -bugprone-easily-swappable-parameters,

View File

@ -161,7 +161,7 @@ namespace DB
try try
{ {
auto & unit = processing_units[current_unit_number]; auto & unit = processing_units[current_unit_number];
assert(unit.status = READY_TO_FORMAT); assert(unit.status == READY_TO_FORMAT);
/// We want to preallocate memory buffer (increase capacity) /// We want to preallocate memory buffer (increase capacity)
/// and put the pointer at the beginning of the buffer /// and put the pointer at the beginning of the buffer