Problems compiling with clang (3.8.21)

Ben Chan benchan at chromium.org
Wed Apr 3 17:48:21 UTC 2019


Could you try these patches?

https://gitlab.freedesktop.org/mobile-broadband/libmbim/merge_requests/8
https://gitlab.freedesktop.org/mobile-broadband/libqmi/merge_requests/35
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/merge_requests/88

Thanks,
Ben


On Tue, Apr 2, 2019 at 10:42 PM Torsten Hilbrich
<torsten.hilbrich at secunet.com> wrote:
>
> On 02.04.19 17:02, Dan Williams wrote:
> > I think -Wno-unused-but-set-variable is actually a mistake and it
> > should be "-Wunused-but-set-variable". But that causes build errors
> > that we should fix.
> >
> > Does clang support -Wunused-but-set-variable?
>
> No.
>
> >
> > Also, does making this change in m4/compiler_warnings.m4 of
> > ModemManager sources help?
> >
> > -               CFLAGS="$CFLAGS $option"
> > +               CFLAGS="$CFLAGS $option -Werror"
>
> This did the job of correctly checking which option is supported:
>
> ...
> checking whether gcc understands -Wunused-but-set-variable... no
> ...
>
> It seems clang is failing on unknown warning options only when using -Werror.
>
> This modification of adding -Werror was sufficient for ModemManager. For libmbim and libqmi the additional option "-Wno-unused-function" was also required, otherwise clang would report errors like:
>
> qmi-ctl.c:352:1: error: unused function 'qmi_message_result_validate' [-Werror,-Wunused-function]
> qmi_message_result_validate (
> ^
> 1 error generated.
>
> or
>
> mbim-basic-connect.c:89:1: error: unused function '_mbim_message_read_mbim_pin_desc_struct_array' [-Werror,-Wunused-function]
> _mbim_message_read_mbim_pin_desc_struct_array (
> ^
>
>         Torsten
>
> _______________________________________________
> ModemManager-devel mailing list
> ModemManager-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


More information about the ModemManager-devel mailing list