teobaluta / NPAQ

Neural Property Approximate Quantifier
https://teobaluta.github.io/NPAQ/
MIT License
8 stars 1 forks source link

Serious issue with control reaching end of non-void function #29

Open msoos opened 2 years ago

msoos commented 2 years ago

With modern compilers these WILL return weird results, jump back to wrong part of the code and generally very seriously misbehave in super-subtle ways. They have caused me to chase bugs for hours. I strongly recommend fixing them. This happens during the build of mlp2cnf:

src/utils.cpp: In function ‘int write_to_meta(std::string, std::string, std::ios_base::openmode)’:
src/utils.cpp:98:1: warning: control reaches end of non-void function [-Wreturn-type]
   98 | }
      | ^
src/constraint_to_cnf.cpp: In function ‘int add_equals_to(std::vector<int>, std::vector<bool>, std::vector<std::vector<int> >&)’:
src/constraint_to_cnf.cpp:183:1: warning: control reaches end of non-void function [-Wreturn-type]
  183 | }
      | ^
src/constraint_to_cnf.cpp: In function ‘int add_equals_to(std::vector<int>, std::vector<int>, std::vector<std::vector<int> >&)’:
src/constraint_to_cnf.cpp:215:1: warning: control reaches end of non-void function [-Wreturn-type]

I really suggest fixing them, should be super-quick :) It will likely save time later!

teobaluta commented 1 year ago

Hi Mate,

Thanks for pointing it out. I should get to fixing these. I did use (by now) an old compiler on Ubuntu 18.04 and did not encounter this error.

Thanks, Teodora