mirror of
https://github.com/Z3Prover/z3
synced 2026-07-16 03:55:42 +00:00
Fix clang warnings about casting away const. (#9933)
This is another PR towards the goal of getting Z3 to compile cleanly when included via FetchContents into clang-tidy, which uses a pretty strict set of warnings. This PR adds ``` "-Wcast-qual" ``` to the set of warnings enabled in the build. This gives warnings like: ``` /Users/daviddetlefs/z3/src/ast/ast.cpp:2897:38: warning: cast from 'app *const *' to 'expr **' drops const qualifier [-Wcast-qual] ``` I fixed these by inserting consts. In some cases, a "const_cast<T>(...)" was necessary.
This commit is contained in:
parent
cd2915ff3c
commit
0adbcaf0d5
4 changed files with 14 additions and 13 deletions
|
|
@ -68,8 +68,8 @@ private:
|
|||
inline ast_manager & m() const { return m_manager; }
|
||||
|
||||
// label for an expression
|
||||
std::string label_of_expr(const expr * e) const {
|
||||
expr_ref er((expr*)e, m());
|
||||
std::string label_of_expr(const expr *e) const {
|
||||
expr_ref er(const_cast<expr *>(e), m());
|
||||
std::ostringstream out;
|
||||
out << er << std::flush;
|
||||
return escape_dot(out.str());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue