sip-build: Warnings with Wextra and clang

Martyn Gigg - STFC UKRI martyn.gigg at stfc.ac.uk
Wed Aug 10 18:41:08 BST 2022


Hi,

I’m using sip to generate some Python bindings to PyQt. Our build environment adds -Wextra to the compiler flags and this seems to generate warnings about missing field initializers when compiled with clang.

I have managed to reproduce this using the basic example at https://www.riverbankcomputing.com/static/Docs/sip/examples.html#a-standalone-project, adding

[tool.sip.bindings.fib]
extra-compile-args = ["-Wextra"]

to the pyproject.toml. Building this with `sip-build` on macOS with clang-13 produces the following warnings:

These bindings will be built: fib.
Generating the fib bindings...
Compiling the 'fib' module...
sip_core.c:182:9: warning: missing field 'am_send' initializer [-Wmissing-field-initializers]
        },
        ^
sip_core.c:258:1: warning: missing field 'wt_reserved' initializer [-Wmissing-field-initializers]
};
^
sip_core.c:9629:9: warning: missing field 'am_send' initializer [-Wmissing-field-initializers]
        },
        ^
sip_core.c:9705:1: warning: missing field 'wt_reserved' initializer [-Wmissing-field-initializers]
};
^
4 warnings generated.
sipfibcmodule.c:19:39: warning: unused parameter 'sipSelf' [-Wunused-parameter]
static PyObject *func_fib_n(PyObject *sipSelf,PyObject *sipArgs)
                                      ^
/Users/dmn58364/Code/git/martyngigg/sip-missing-field-error/build/fib/sipfibcmodule.c:84:1: warning: missing field 'em_exception_handler' initializer [-Wmissing-field-initializers]
};
^
2 warnings generated.
The project has been built.

I can disable the warnings in my code but could there be an underlying issue here?

Many thanks,

Martyn

This email and any attachments are intended solely for the use of the named recipients. If you are not the intended recipient you must not use, disclose, copy or distribute this email or any of its attachments and should notify the sender immediately and delete this email from your system. UK Research and Innovation (UKRI) has taken every reasonable precaution to minimise risk of this email or any attachments containing viruses or malware but the recipient should carry out its own virus and malware checks before opening the attachments. UKRI does not accept any liability for any losses or damages which the recipient may sustain due to presence of any viruses.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20220810/75ae9fa7/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001[99].png
Type: image/png
Size: 47116 bytes
Desc: image001[99].png
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20220810/75ae9fa7/attachment-0001.png>


More information about the PyQt mailing list