diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 8ead035d5..6ffd89978 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -40,8 +40,9 @@ jobs: - name: Install PySCIPOpt run: | - export CFLAGS="-O0 -ggdb" # disable compiler optimizations for faster builds - python -m pip install . + export CFLAGS="-O0 -ggdb -Wall -Wextra -Werror" # Debug mode. More warnings. Warnings as errors. + python -m pip install . -v 2>&1 | tee build.log + grep -i "warning" build.log || true - name: Run pyscipopt tests run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d44eda6c..ce0a27178 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Generalized getLhs() and getRhs() to additionally support any linear type constraint ### Fixed - Raised an error when an expression is used when a variable is required +- Fixed some compile warnings ### Changed - MatrixExpr.sum() now supports axis arguments and can return either a scalar or MatrixExpr depending on the result dimensions ### Removed diff --git a/src/pyscipopt/event.pxi b/src/pyscipopt/event.pxi index 914e882ed..559d8c44a 100644 --- a/src/pyscipopt/event.pxi +++ b/src/pyscipopt/event.pxi @@ -39,7 +39,7 @@ cdef class Eventhdlr: # local helper functions for the interface -cdef Eventhdlr getPyEventhdlr(SCIP_EVENTHDLR* eventhdlr) noexcept with gil: +cdef Eventhdlr getPyEventhdlr(SCIP_EVENTHDLR* eventhdlr): cdef SCIP_EVENTHDLRDATA* eventhdlrdata eventhdlrdata = SCIPeventhdlrGetData(eventhdlr) return eventhdlrdata diff --git a/src/pyscipopt/expr.pxi b/src/pyscipopt/expr.pxi index 563c73d4a..2fc56f5cb 100644 --- a/src/pyscipopt/expr.pxi +++ b/src/pyscipopt/expr.pxi @@ -358,7 +358,7 @@ cdef class ExprCons: def __repr__(self): return 'ExprCons(%s, %s, %s)' % (self.expr, self._lhs, self._rhs) - def __nonzero__(self): + def __bool__(self): '''Make sure that equality of expressions is not asserted with ==''' msg = """Can't evaluate constraints as booleans. diff --git a/src/pyscipopt/scip.pxd b/src/pyscipopt/scip.pxd index 175c062e5..7059a9f3c 100644 --- a/src/pyscipopt/scip.pxd +++ b/src/pyscipopt/scip.pxd @@ -408,12 +408,6 @@ cdef extern from "scip/scip.h": ctypedef struct SCIP_PROPDATA: pass - ctypedef struct SCIP_PROPTIMING: - pass - - ctypedef struct SCIP_PRESOLTIMING: - pass - ctypedef struct SCIP_PRESOL: pass @@ -456,9 +450,6 @@ cdef extern from "scip/scip.h": ctypedef struct SCIP_PRESOL: pass - ctypedef struct SCIP_HEURTIMING: - pass - ctypedef struct SCIP_SEPA: pass @@ -510,9 +501,6 @@ cdef extern from "scip/scip.h": ctypedef struct BMS_BLKMEM: pass - ctypedef struct SCIP_EXPR: - pass - ctypedef struct SCIP_EXPRHDLR: pass @@ -708,7 +696,6 @@ cdef extern from "scip/scip.h": SCIP_Real SCIPgetLocalTransEstimate(SCIP* scip) # Solve Methods - SCIP_RETCODE SCIPsolve(SCIP* scip) SCIP_RETCODE SCIPsolve(SCIP* scip) noexcept nogil SCIP_RETCODE SCIPsolveConcurrent(SCIP* scip) SCIP_RETCODE SCIPfreeTransform(SCIP* scip) diff --git a/src/pyscipopt/scip.pxi b/src/pyscipopt/scip.pxi index cdedebe83..26abf8c29 100644 --- a/src/pyscipopt/scip.pxi +++ b/src/pyscipopt/scip.pxi @@ -7974,7 +7974,6 @@ cdef class Model: """ raise Warning("model.getDualMultiplier(cons) is deprecated: please use model.getDualsolLinear(cons)") - return self.getDualsolLinear(cons) def getDualfarkasLinear(self, Constraint cons): """