diff --git a/.travis.yml b/.travis.yml index 581013c..5dda5e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,14 @@ matrix: - python: 3.6 env: TOXENV=doc +env: + global: + # -Wno-int-in-bool-context: don't complain about PyMem_MALLOC() + # -Werror: turn all warnings into fatal errors + - CFLAGS="-Wno-int-in-bool-context -Werror" + # pass CFLAGS and WITH_GCOV to tox tasks + - TOX_TESTENV_PASSENV="CFLAGS WITH_GCOV" + install: - pip install "pip>=7.1.0" - pip install tox-travis tox codecov coverage diff --git a/Modules/LDAPObject.c b/Modules/LDAPObject.c index 3fbdef1..1438700 100644 --- a/Modules/LDAPObject.c +++ b/Modules/LDAPObject.c @@ -108,7 +108,8 @@ Tuple_to_LDAPMod( PyObject* tup, int no_op ) Py_ssize_t i, len, nstrs; if (!PyTuple_Check(tup)) { - return LDAPerror_TypeError("expected a tuple", tup); + LDAPerror_TypeError("expected a tuple", tup); + return NULL; } if (no_op) { @@ -205,13 +206,15 @@ List_to_LDAPMods( PyObject *list, int no_op ) { PyObject *item; if (!PySequence_Check(list)) { - return LDAPerror_TypeError("expected list of tuples", list); + LDAPerror_TypeError("expected list of tuples", list); + return NULL; } len = PySequence_Length(list); if (len < 0) { - return LDAPerror_TypeError("expected list of tuples", list); + LDAPerror_TypeError("expected list of tuples", list); + return NULL; } lms = PyMem_NEW(LDAPMod *, len + 1); diff --git a/Modules/ldapcontrol.c b/Modules/ldapcontrol.c index 3f5b2c4..7d8fbe3 100644 --- a/Modules/ldapcontrol.c +++ b/Modules/ldapcontrol.c @@ -4,6 +4,7 @@ #include "LDAPObject.h" #include "ldapcontrol.h" #include "berval.h" +#include "constants.h" #include "lber.h" @@ -71,7 +72,8 @@ Tuple_to_LDAPControl( PyObject* tup ) Py_ssize_t len; if (!PyTuple_Check(tup)) { - return LDAPerror_TypeError("expected a tuple", tup); + LDAPerror_TypeError("expected a tuple", tup); + return NULL; } if (!PyArg_ParseTuple( tup, "sbO", &oid, &iscritical, &bytes )) diff --git a/Modules/ldapmodule.c b/Modules/ldapmodule.c index bd54313..4c2c4ec 100644 --- a/Modules/ldapmodule.c +++ b/Modules/ldapmodule.c @@ -37,7 +37,7 @@ static PyMethodDef methods[] = { /* Common initialization code */ -PyObject* init_ldap_module() +PyObject* init_ldap_module(void) { PyObject *m, *d;