sip-build: Warnings with Wextra and clang

Phil Thompson phil at riverbankcomputing.com
Wed Sep 7 17:54:43 BST 2022


On 10/08/2022 18:41, Martyn Gigg - STFC UKRI wrote:
> 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?

The warnings are all benign but fixed anyway.

Thanks,
Phil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001[99].png
Type: image/png
Size: 47116 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20220907/716c846c/attachment-0001.png>


More information about the PyQt mailing list