From 6cbbeebdc8433993fb7075006e42fa32a53a36b4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 9 Nov 2021 09:50:55 +0200 Subject: 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. --- libbuild2/algorithm.ixx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'libbuild2') 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 -- cgit v1.1