Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remained GCC 10 warnings #4463

Closed
XVilka opened this issue May 25, 2020 · 3 comments
Closed

Remained GCC 10 warnings #4463

XVilka opened this issue May 25, 2020 · 3 comments

Comments

@XVilka
Copy link
Contributor

XVilka commented May 25, 2020

Continuation of #4390

[  8%] Building CXX object src/math/polynomial/CMakeFiles/polynomial.dir/polynomial.cpp.o
/home/akochkov/data/math/z3/src/math/polynomial/polynomial.cpp: 在成员函数‘void polynomial::tmp_monomial::init(unsigned int, const polynomial::power*)’中:
/home/akochkov/data/math/z3/src/math/polynomial/polynomial.cpp:553:60: 警告:‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class polynomial::power’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
  553 |             memcpy(m_ptr->m_powers, pws, sizeof(power) * sz);
      |                                                            ^
/home/akochkov/data/math/z3/src/math/polynomial/polynomial.cpp:92:11: 附注:‘class polynomial::power’ declared here
   92 |     class power : public std::pair<var, unsigned> {
      |           ^~~~~
/home/akochkov/data/math/z3/src/smt/theory_str.cpp: In member function ‘void smt::theory_str::check_consistency_prefix(expr*, bool)’:
/home/akochkov/data/math/z3/src/smt/theory_str.cpp:7049:16: warning: ‘haystack’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 7049 |         expr * haystack;
      |                ^~~~~~~~
/home/akochkov/data/math/z3/src/smt/theory_str.cpp:4531:36: warning: ‘needle’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 4531 |         return z3str2_get_eqc_value(n, hasEqcValue);
      |                ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/akochkov/data/math/z3/src/smt/theory_str.cpp:7048:16: note: ‘needle’ was declared here
 7048 |         expr * needle;
      |                ^~~~~~
/home/akochkov/data/math/z3/src/smt/theory_str.cpp: In member function ‘void smt::theory_str::check_consistency_suffix(expr*, bool)’:
/home/akochkov/data/math/z3/src/smt/theory_str.cpp:7076:16: warning: ‘haystack’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 7076 |         expr * haystack;
      |                ^~~~~~~~
/home/akochkov/data/math/z3/src/smt/theory_str.cpp:4531:36: warning: ‘needle’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 4531 |         return z3str2_get_eqc_value(n, hasEqcValue);
      |                ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/akochkov/data/math/z3/src/smt/theory_str.cpp:7075:16: note: ‘needle’ was declared here
 7075 |         expr * needle;
      |                ^~~~~~
/home/akochkov/data/math/z3/src/smt/theory_str.cpp: In member function ‘void smt::theory_str::check_consistency_contains(expr*, bool)’:
/home/akochkov/data/math/z3/src/smt/theory_str.cpp:7103:16: warning: ‘haystack’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 7103 |         expr * haystack;
      |                ^~~~~~~~
/home/akochkov/data/math/z3/src/smt/theory_str.cpp:4531:36: warning: ‘needle’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 4531 |         return z3str2_get_eqc_value(n, hasEqcValue);
      |                ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/akochkov/data/math/z3/src/smt/theory_str.cpp:7102:16: note: ‘needle’ was declared here
 7102 |         expr * needle;
      |                ^~~~~~

And one minor defined but not used, though this one can be ignored safely I think:

In file included from /home/akochkov/data/math/z3/src/ast/rewriter/th_rewriter.cpp:31:
/home/akochkov/data/math/z3/src/ast/rewriter/rewriter_def.h:693:6: warning: ‘void rewriter_tpl<Config>::update_inv_binding_at(unsigned int, expr*) [with Config = {anonymous}::th_rewriter_cfg]’ defined but not used [-Wunused-function]
  693 | void rewriter_tpl<Config>::update_inv_binding_at(unsigned i, expr* binding) {
      |      ^~~~~~~~~~~~~~~~~~~~
/home/akochkov/data/math/z3/src/ast/rewriter/rewriter_def.h:698:6: warning: ‘void rewriter_tpl<Config>::update_binding_at(unsigned int, expr*) [with Config = {anonymous}::th_rewriter_cfg]’ defined but not used [-Wunused-function]
  698 | void rewriter_tpl<Config>::update_binding_at(unsigned i, expr* binding) {
      |      ^~~~~~~~~~~~~~~~~~~~
/home/akochkov/data/math/z3/src/ast/rewriter/rewriter_def.h:665:6: warning: ‘void rewriter_tpl<Config>::set_bindings(unsigned int, expr* const*) [with Config = {anonymous}::th_rewriter_cfg]’ defined but not used [-Wunused-function]
  665 | void rewriter_tpl<Config>::set_bindings(unsigned num_bindings, expr * const * bindings) {
      |      ^~~~~~~~~~~~~~~~~~~~
/home/akochkov/data/math/z3/src/ast/rewriter/rewriter_def.h:646:6: warning: ‘void rewriter_tpl<Config>::cleanup() [with Config = {anonymous}::th_rewriter_cfg]’ defined but not used [-Wunused-function]
  646 | void rewriter_tpl<Config>::cleanup() {
      |      ^~~~~~~~~~~~~~~~~~~~
/home/akochkov/data/math/z3/src/ast/rewriter/rewriter_def.h:613:6: warning: ‘bool rewriter_tpl<Config>::not_rewriting() const [with Config = {anonymous}::th_rewriter_cfg]’ defined but not used [-Wunused-function]
  613 | bool rewriter_tpl<Config>::not_rewriting() const {
      |      ^~~~~~~~~~~~~~~~~~~~
/home/akochkov/data/math/z3/src/ast/rewriter/rewriter_def.h:656:6: warning: ‘void rewriter_tpl<Config>::display_bindings(std::ostream&) [with Config = {anonymous}::th_rewriter_cfg]’ defined but not used [-Wunused-function]
  656 | void rewriter_tpl<Config>::display_bindings(std::ostream& out) {
      |      ^~~~~~~~~~~~~~~~~~~~
/home/akochkov/data/math/z3/src/math/lp/nla_core.cpp: In destructor ‘nla::new_lemma::~new_lemma()’:
/home/akochkov/data/math/z3/src/math/lp/nla_core.cpp:1053:16: warning: unused variable ‘i’ [-Wunused-variable]
 1053 |     static int i = 0;
      |                ^
/home/akochkov/data/math/z3/src/math/lp/nla_core.cpp: At global scope:
/home/akochkov/data/math/z3/src/math/lp/nla_core.cpp:1053:16: warning: ‘i’ defined but not used [-Wunused-variable]
/home/akochkov/data/math/z3/src/smt/seq_regex.cpp: In member function ‘bool smt::seq_regex::block_unfolding(smt::literal, unsigned int)’:
/home/akochkov/data/math/z3/src/smt/seq_regex.cpp:212:15: warning: unused variable ‘t’ [-Wunused-variable]
  212 |         expr* t = nullptr;
      |               ^
/home/akochkov/data/math/z3/src/smt/smt_induction.cpp: In member function ‘bool smt::induction_lemmas::operator()(smt::literal)’:
/home/akochkov/data/math/z3/src/smt/smt_induction.cpp:403:14: warning: unused variable ‘num’ [-Wunused-variable]
  403 |     unsigned num = m_num_lemmas;
      |              ^~~
/home/akochkov/data/math/z3/src/smt/smt_induction.cpp: In member function ‘void smt::induction_lemmas::apply_induction(smt::literal, const induction_positions_t&)’:
/home/akochkov/data/math/z3/src/smt/smt_induction.cpp:497:18: warning: unused variable ‘i’ [-Wunused-variable]
  497 |         unsigned i = 0;
      |                  ^
In file included from /home/akochkov/data/math/z3/src/smt/theory_utvpi.cpp:18:
/home/akochkov/data/math/z3/src/smt/theory_utvpi_def.h: In instantiation of ‘void smt::theory_utvpi<Ext>::model_validate() [with Ext = smt::idl_ext]’:
/home/akochkov/data/math/z3/src/smt/theory_utvpi.cpp:22:20:   required from here
/home/akochkov/data/math/z3/src/smt/theory_utvpi_def.h:824:18: warning: variable ‘ok’ set but not used [-Wunused-but-set-variable]
  824 |             bool ok = true;
      |                  ^~
/home/akochkov/data/math/z3/src/smt/theory_utvpi_def.h: In instantiation of ‘void smt::theory_utvpi<Ext>::model_validate() [with Ext = smt::rdl_ext]’:
/home/akochkov/data/math/z3/src/smt/theory_utvpi.cpp:23:20:   required from here
/home/akochkov/data/math/z3/src/smt/theory_utvpi_def.h:824:18: warning: variable ‘ok’ set but not used [-Wunused-but-set-variable]

cc @nunoplopes

@nunoplopes
Copy link
Collaborator

I fixed all the warnings excluding the non-used function ones: d8cea7c
Those functions are used, just in debug/trace mode and I didn't have patience to get rid of them..

@XVilka
Copy link
Contributor Author

XVilka commented May 26, 2020

Thank you!

@NikolajBjorner
Copy link
Contributor

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants