3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-30 20:38:56 +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:
davedets 2026-06-23 18:57:46 -07:00 committed by GitHub
parent cd2915ff3c
commit 0adbcaf0d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 14 additions and 13 deletions

View file

@ -24,6 +24,7 @@ set(CLANG_ONLY_WARNINGS
"-Wsuggest-override"
"-Winconsistent-missing-override"
"-Wno-missing-field-initializers"
"-Wcast-qual"
)
set(MSVC_WARNINGS "/W3")