mirror of
https://github.com/Z3Prover/z3
synced 2026-08-02 12:13:25 +00:00
Add -Wignored-qualifiers in clang build, and fix one resulting warning. (#10325)
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. (Only 4 more warnings after this one!)
This PR adds -Wignored-qualifiers. It detects only one violation: a
function whose by-value return type (unsigned) has a const qualifier.
Here is the error message:
```
/Users/daviddetlefs/z3/src/math/lp/dioph_eq.cpp:1518:9: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
1518 | const unsigned sub_index(unsigned k) const {
| ^~~~~
```
Seems worth fixing.
This commit is contained in:
parent
1a73005048
commit
214726519d
2 changed files with 2 additions and 1 deletions
|
|
@ -27,6 +27,7 @@ set(CLANG_ONLY_WARNINGS
|
|||
"-Wcast-qual"
|
||||
"-Wimplicit-fallthrough"
|
||||
"-Wextra-semi"
|
||||
"-Wignored-qualifiers"
|
||||
)
|
||||
|
||||
set(MSVC_WARNINGS "/W3")
|
||||
|
|
|
|||
|
|
@ -1515,7 +1515,7 @@ namespace lp {
|
|||
return ret;
|
||||
}
|
||||
|
||||
const unsigned sub_index(unsigned k) const {
|
||||
unsigned sub_index(unsigned k) const {
|
||||
return m_k2s[k];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue