Skip to content

Commit

Permalink
Fix strict-prototypes compile warnings (#828)
Browse files Browse the repository at this point in the history
* Fix strict-prototypes compile warnings

* Add a change note for PR #828

---------

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <webknjaz@redhat.com>
  • Loading branch information
hoodmane and webknjaz authored Dec 27, 2023
1 parent 38cbef7 commit cc556df
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGES/828.contrib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Added an explicit ``void`` for arguments in C-function signatures
which addresses the following compiler warning:

.. code-block:: console
warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
-- by :user:`hoodmane`
2 changes: 1 addition & 1 deletion multidict/_multidict.c
Original file line number Diff line number Diff line change
Expand Up @@ -1695,7 +1695,7 @@ static PyModuleDef multidict_module = {
};

PyMODINIT_FUNC
PyInit__multidict()
PyInit__multidict(void)
{
#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 9
multidict_str_lower = PyUnicode_InternFromString("lower");
Expand Down
2 changes: 1 addition & 1 deletion multidict/_multilib/iter.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ static PyTypeObject multidict_keys_iter_type = {
};

static inline int
multidict_iter_init()
multidict_iter_init(void)
{
if (PyType_Ready(&multidict_items_iter_type) < 0 ||
PyType_Ready(&multidict_values_iter_type) < 0 ||
Expand Down
2 changes: 1 addition & 1 deletion multidict/_multilib/views.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ static PyTypeObject multidict_valuesview_type = {


static inline int
multidict_views_init()
multidict_views_init(void)
{
PyObject *reg_func_call_result = NULL;
PyObject *module = PyImport_ImportModule("multidict._multidict_base");
Expand Down

0 comments on commit cc556df

Please sign in to comment.