Skip to content
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
1 change: 1 addition & 0 deletions CHANGES/1217.contrib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix compiler warnings and convert them to errors -- by :user:`asvetlov`.
2 changes: 1 addition & 1 deletion multidict/_multidict.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ _multidict_extend_parse_args(mod_state *state, PyObject *args, PyObject *kwds,
const char *name, PyObject **parg)
{
Py_ssize_t size = 0;
Py_ssize_t s;
Py_ssize_t s = 0;
if (args) {
s = PyTuple_GET_SIZE(args);
if (s > 1) {
Expand Down
10 changes: 6 additions & 4 deletions multidict/_multilib/hashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ GROWTH_RATE(MultiDictObject *md)
return md->used * 3;
}

#ifndef NDEBUG
static inline int
_md_check_consistency(MultiDictObject *md, bool update);
static inline int
_md_dump(MultiDictObject *md);

#ifndef NDEBUG
#define ASSERT_CONSISTENT(md, update) assert(_md_check_consistency(md, update))
#else
#define ASSERT_CONSISTENT(md, update) assert(1)
Expand Down Expand Up @@ -873,6 +873,8 @@ md_get_one(MultiDictObject *md, PyObject *key, PyObject **ret)
static inline int
md_get_all(MultiDictObject *md, PyObject *key, PyObject **ret)
{
int tmp;
PyObject *value = NULL;
*ret = NULL;

md_finder_t finder = {0};
Expand All @@ -887,9 +889,6 @@ md_get_all(MultiDictObject *md, PyObject *key, PyObject **ret)
goto fail;
}

int tmp;
PyObject *value = NULL;

while ((tmp = md_find_next(&finder, NULL, &value)) > 0) {
if (*ret == NULL) {
*ret = PyList_New(1);
Expand Down Expand Up @@ -1900,6 +1899,8 @@ md_clear(MultiDictObject *md)
return 0;
}

#ifndef NDEBUG

static inline int
_md_check_consistency(MultiDictObject *md, bool update)
{
Expand Down Expand Up @@ -1992,6 +1993,7 @@ _md_dump(MultiDictObject *md)
printf("\n");
return 1;
}
#endif // NDEBUG

#ifdef __cplusplus
}
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
if platform.system() != "Windows":
CFLAGS.extend(
[
"-std=c99",
"-std=c11",
"-Wall",
"-Wsign-compare",
"-Wconversion",
"-fno-strict-aliasing",
"-pedantic",
"-Wno-conversion",
"-Werror",
]
)

Expand Down
Loading