Skip to content

Fix several compiler warnings and make warnings fatal errors #49

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

Merged
merged 4 commits into from
Nov 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions Modules/LDAPObject.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,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) {
Expand Down Expand Up @@ -209,13 +210,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);
Expand Down
4 changes: 3 additions & 1 deletion Modules/ldapcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "LDAPObject.h"
#include "ldapcontrol.h"
#include "berval.h"
#include "constants.h"

#include "lber.h"

Expand Down Expand Up @@ -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 ))
Expand Down
2 changes: 1 addition & 1 deletion Modules/ldapmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static PyMethodDef methods[] = {


/* Common initialization code */
PyObject* init_ldap_module()
PyObject* init_ldap_module(void)
{
PyObject *m, *d;

Expand Down
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