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

Avoid using -fpermissive flag #36

Closed
aabbas-brook opened this issue Nov 22, 2022 · 2 comments
Closed

Avoid using -fpermissive flag #36

aabbas-brook opened this issue Nov 22, 2022 · 2 comments

Comments

@aabbas-brook
Copy link

Hi everyone,
First of all, thank you for the work and the documentation you have done here, this is great.
When trying to compile the simple example (that I putted in a test file) :

#include <scip/scip.h>
#include <string>

TEST(solver, solver_SCIP_SOPLEX_initializarion)
{
    SCIP *scip = NULL;
    SCIP_CALL(SCIPcreate(&scip));                  // initialize SCIP
    SCIPinfoMessage(scip, NULL, "Hello world.\n"); // output greeting
    SCIP_CALL(SCIPfree(&scip));                    // free SCIP
    BMScheckEmptyMemory();
    ASSERT_EQ(1, 1);
}

I am faced to a message error:

In member function ‘virtual void solver_solver_SCIP_SOPLEX_initializarion_Test::TestBody()’:
**[...]**  error: return-statement with a value, in function returning ‘void’ [-fpermissive]

This can be solved by adding in cmake : set(CMAKE_CXX_FLAGS "-fpermissive -std=c++0x"). This point solves the issue but is there a better way to solve this problem?

@svigerske
Copy link
Member

SCIP_CALL is a macro that includes a return statement. Use something like SCIP_CALL_ABORT instead.

@aabbas-brook
Copy link
Author

Thank you !

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