3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-10 19:27:06 +00:00

make use of warning_msg safe for formatting. Thanks to Scott McPeak for reporting

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2016-06-14 08:10:10 -07:00
parent b11f9050e3
commit 9253ca9d86
7 changed files with 8 additions and 9 deletions

View file

@ -37,7 +37,7 @@ extern "C" {
catch (z3_exception & ex) {
// The error handler is only available for contexts
// Just throw a warning.
warning_msg(ex.msg());
warning_msg("%s", ex.msg());
}
}
@ -62,7 +62,7 @@ extern "C" {
catch (z3_exception & ex) {
// The error handler is only available for contexts
// Just throw a warning.
warning_msg(ex.msg());
warning_msg("%s", ex.msg());
return Z3_FALSE;
}
}
@ -88,7 +88,7 @@ extern "C" {
catch (z3_exception & ex) {
// The error handler is only available for contexts
// Just throw a warning.
warning_msg(ex.msg());
warning_msg("%s", ex.msg());
}
}

View file

@ -1965,7 +1965,7 @@ bool ast_manager::check_sorts(ast const * n) const {
return true;
}
catch (ast_exception & ex) {
warning_msg(ex.msg());
warning_msg("%s", ex.msg());
return false;
}
}

View file

@ -66,7 +66,7 @@ struct well_sorted_proc {
strm << "Expected sort: " << mk_pp(expected_sort, m_manager) << "\n";
strm << "Actual sort: " << mk_pp(actual_sort, m_manager) << "\n";
strm << "Function sort: " << mk_pp(decl, m_manager) << ".";
warning_msg(strm.str().c_str());
warning_msg("%s", strm.str().c_str());
m_error = true;
return;
}

View file

@ -391,7 +391,7 @@ namespace datalog {
std::ostringstream buffer;
buffer << "creating large table of size " << upper_bound;
if (p) buffer << " for relation " << p->get_name();
warning_msg(buffer.str().c_str());
warning_msg("%s", buffer.str().c_str());
}
for(table_element i = 0; i < upper_bound; i++) {

View file

@ -1034,7 +1034,7 @@ namespace smt2 {
else {
std::ostringstream str;
str << "unknown attribute " << id;
warning_msg(str.str().c_str());
warning_msg("%s", str.str().c_str());
next();
// just consume the
consume_sexpr();

View file

@ -250,7 +250,7 @@ namespace smt {
std::stringstream msg;
msg << "found non utvpi logic expression:\n" << mk_pp(n, get_manager()) << "\n";
TRACE("utvpi", tout << msg.str(););
warning_msg(msg.str().c_str());
warning_msg("%s", msg.str().c_str());
get_context().push_trail(value_trail<context, bool>(m_non_utvpi_exprs));
m_non_utvpi_exprs = true;
}

View file

@ -167,4 +167,3 @@ void warning_msg(const char * msg, ...) {
va_end(args);
}
}