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

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

Open
msoos opened this issue Jan 31, 2022 · 1 comment
Open

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

msoos opened this issue Jan 31, 2022 · 1 comment
Assignees

Comments

@msoos
Copy link

msoos commented Jan 31, 2022

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
Copy link
Owner

teobaluta commented Apr 27, 2023

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

@teobaluta teobaluta self-assigned this Apr 27, 2023
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

2 participants