mirror of
https://github.com/Z3Prover/z3
synced 2026-06-26 02:20:58 +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
|
|
@ -621,7 +621,7 @@ struct z3_replayer::imp {
|
|||
|
||||
Z3_symbol get_symbol(unsigned pos) const {
|
||||
check_arg(pos, SYMBOL);
|
||||
return (Z3_symbol)m_args[pos].m_sym;
|
||||
return (Z3_symbol)const_cast<void*>(m_args[pos].m_sym);
|
||||
}
|
||||
|
||||
void * get_obj(unsigned pos) const {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue