Skip to content

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

Description

@msoos

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions