aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-11-09 09:50:55 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-11-09 09:50:55 +0200
commit6cbbeebdc8433993fb7075006e42fa32a53a36b4 (patch)
tree70c7d2be1b36c1a78f69ef6ca89a087f23d2a64d
parenteb000f6aa31f48b36ad2fcd09d14559f43106ca2 (diff)
Suppress few unused variable warnings caused by NDEBUG
While we normally don't bother, these specific cases cause failures in the ad hoc C++ recipe tests.
-rw-r--r--libbuild2/algorithm.ixx15
1 files changed, 10 insertions, 5 deletions
diff --git a/libbuild2/algorithm.ixx b/libbuild2/algorithm.ixx
index 24d9e5b..d64747d 100644
--- a/libbuild2/algorithm.ixx
+++ b/libbuild2/algorithm.ixx
@@ -143,7 +143,8 @@ namespace build2
if (target != nullptr && prev != this)
{
const target_lock* cur (stack (prev));
- assert (cur == this);
+ if (cur != this) // NDEBUG
+ assert (cur == this);
prev = this;
}
}
@@ -158,7 +159,8 @@ namespace build2
if (prev != this)
{
const target_lock* cur (stack (prev));
- assert (cur == this);
+ if (cur != this) // NDEBUG
+ assert (cur == this);
}
target = nullptr;
@@ -175,7 +177,8 @@ namespace build2
if (prev != this)
{
const target_lock* cur (stack (prev));
- assert (cur == this);
+ if (cur != this) // NDEBUG
+ assert (cur == this);
}
target = nullptr;
@@ -199,7 +202,8 @@ namespace build2
if (x.prev != &x)
{
const target_lock* cur (stack (this));
- assert (cur == &x);
+ if (cur != &x) // NDEBUG
+ assert (cur == &x);
prev = x.prev;
}
else
@@ -225,7 +229,8 @@ namespace build2
if (x.prev != &x)
{
const target_lock* cur (stack (this));
- assert (cur == &x);
+ if (cur != &x) // NDEBUG
+ assert (cur == &x);
prev = x.prev;
}
else