From 54dd6afbae14d4f17a1dee4766331f932d66e117 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Sat, 9 Jun 2018 19:37:30 +0100 Subject: Fix compiler warnings if assertions are disabled --- lib/Core/Searcher.cpp | 1 + lib/Solver/Z3Solver.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lib/Core/Searcher.cpp b/lib/Core/Searcher.cpp index dfeb15de..0c1f4316 100644 --- a/lib/Core/Searcher.cpp +++ b/lib/Core/Searcher.cpp @@ -151,6 +151,7 @@ RandomSearcher::update(ExecutionState *current, ie = removedStates.end(); it != ie; ++it) { ExecutionState *es = *it; + __attribute__((unused)) bool ok = false; for (std::vector::iterator it = states.begin(), diff --git a/lib/Solver/Z3Solver.cpp b/lib/Solver/Z3Solver.cpp index e89c9463..3eaa8c85 100644 --- a/lib/Solver/Z3Solver.cpp +++ b/lib/Solver/Z3Solver.cpp @@ -352,6 +352,7 @@ SolverImpl::SolverRunStatus Z3SolverImpl::handleSolverResponse( ::Z3_ast arrayElementExpr; Z3ASTHandle initial_read = builder->getInitialRead(array, offset); + __attribute__((unused)) bool successfulEval = Z3_model_eval(builder->ctx, theModel, initial_read, /*model_completion=*/Z3_TRUE, &arrayElementExpr); @@ -362,6 +363,7 @@ SolverImpl::SolverRunStatus Z3SolverImpl::handleSolverResponse( "Evaluated expression has wrong sort"); int arrayElementValue = 0; + __attribute__((unused)) bool successGet = Z3_get_numeral_int(builder->ctx, arrayElementExpr, &arrayElementValue); assert(successGet && "failed to get value back"); @@ -417,6 +419,7 @@ bool Z3SolverImpl::validateZ3Model(::Z3_solver &theSolver, ::Z3_model &theModel) Z3_ast_vector_get(builder->ctx, constraints, index), builder->ctx); ::Z3_ast rawEvaluatedExpr; + __attribute__((unused)) bool successfulEval = Z3_model_eval(builder->ctx, theModel, constraint, /*model_completion=*/Z3_TRUE, &rawEvaluatedExpr); -- cgit 1.4.1