Skip to content

Commit 773defa

Browse files
authored
Merge pull request python-ldap#49 – Fix several compiler warnings and make warnings fatal errors
python-ldap#49
2 parents 0ec9b74 + 5b2d2f9 commit 773defa

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ matrix:
3737
- python: 3.6
3838
env: TOXENV=doc
3939

40+
env:
41+
global:
42+
# -Wno-int-in-bool-context: don't complain about PyMem_MALLOC()
43+
# -Werror: turn all warnings into fatal errors
44+
- CFLAGS="-Wno-int-in-bool-context -Werror"
45+
# pass CFLAGS and WITH_GCOV to tox tasks
46+
- TOX_TESTENV_PASSENV="CFLAGS WITH_GCOV"
47+
4048
install:
4149
- pip install "pip>=7.1.0"
4250
- pip install tox-travis tox codecov coverage

Modules/LDAPObject.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ Tuple_to_LDAPMod( PyObject* tup, int no_op )
108108
Py_ssize_t i, len, nstrs;
109109

110110
if (!PyTuple_Check(tup)) {
111-
return LDAPerror_TypeError("expected a tuple", tup);
111+
LDAPerror_TypeError("expected a tuple", tup);
112+
return NULL;
112113
}
113114

114115
if (no_op) {
@@ -205,13 +206,15 @@ List_to_LDAPMods( PyObject *list, int no_op ) {
205206
PyObject *item;
206207

207208
if (!PySequence_Check(list)) {
208-
return LDAPerror_TypeError("expected list of tuples", list);
209+
LDAPerror_TypeError("expected list of tuples", list);
210+
return NULL;
209211
}
210212

211213
len = PySequence_Length(list);
212214

213215
if (len < 0) {
214-
return LDAPerror_TypeError("expected list of tuples", list);
216+
LDAPerror_TypeError("expected list of tuples", list);
217+
return NULL;
215218
}
216219

217220
lms = PyMem_NEW(LDAPMod *, len + 1);

Modules/ldapcontrol.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "LDAPObject.h"
55
#include "ldapcontrol.h"
66
#include "berval.h"
7+
#include "constants.h"
78

89
#include "lber.h"
910

@@ -71,7 +72,8 @@ Tuple_to_LDAPControl( PyObject* tup )
7172
Py_ssize_t len;
7273

7374
if (!PyTuple_Check(tup)) {
74-
return LDAPerror_TypeError("expected a tuple", tup);
75+
LDAPerror_TypeError("expected a tuple", tup);
76+
return NULL;
7577
}
7678

7779
if (!PyArg_ParseTuple( tup, "sbO", &oid, &iscritical, &bytes ))

Modules/ldapmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static PyMethodDef methods[] = {
3737

3838

3939
/* Common initialization code */
40-
PyObject* init_ldap_module()
40+
PyObject* init_ldap_module(void)
4141
{
4242
PyObject *m, *d;
4343

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy