On Mon, Feb 9, 2026 at 9:16 PM Ilya Maximets <[email protected]> wrote:
>
> On 2/8/26 5:27 PM, Dmitry Mityugov wrote:
> > This patch enables two compiler options, -Wmissing-declarations and
> > -Wmissing-variable-declarations, to help minimize visibility of symbols
> > used inside a single module, and catch other possible problems like
> > unused functions and variables. It also adjusts `_OVS_CHECK_CC_OPTION`
> > macro to work correctly with -Wmissing-variable-declarations option.
> >
> > This patch also declares `impl_set_masked_funcs` array in
> > lib/odp-execute-avx512.c as `static`, because it isn't used anywhere
> > else.
> >
> > Signed-off-by: Dmitry Mityugov <[email protected]>
> > ---
> >  acinclude.m4             | 2 +-
> >  configure.ac             | 2 ++
> >  lib/odp-execute-avx512.c | 2 +-
> >  3 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/acinclude.m4 b/acinclude.m4
> > index 586163ef3..599179a31 100644
> > --- a/acinclude.m4
> > +++ b/acinclude.m4
> > @@ -614,7 +614,7 @@ AC_DEFUN([_OVS_CHECK_CC_OPTION], [dnl
> >       dnl instead of testing for -Wno-<foo>, test for the positive version.
> >       CFLAGS="$CFLAGS $WERROR m4_bpatsubst([$1], [-Wno-], [-W])"
> >       AC_COMPILE_IFELSE(
> > -       [AC_LANG_SOURCE([int x;])],
> > +       [AC_LANG_SOURCE([static int x;])],
>
> Unfortunately, this breaks detection of -Werror:
>
> configure:24439: checking whether clang accepts -Werror
> configure:24451: clang -c -g -O2 -Wall  -Werror  conftest.c >&5
> conftest.c:73:12: error: unused variable 'x' [-Werror,-Wunused-variable]
>    73 | static int x;
>       |            ^
> 1 error generated.
> configure:24451: $? = 1
> configure:24467: result: no
>
> And without -Werror all other checks are pointless.  Hence the
> reason FreeBSD CI fails in Cirrus.
>
> We need a minimal and fully correct program that does not
> produce any warnings.  The AC_LANG_PROGRAM([], []) might
> work, I suppose.  But we need to make sure that detection
> of other things is not broken as well...
>
> Best regards, Ilya Maximets.

Hi Ilya,

Thank you for your comments. I reproduced the problem and will submit
a fix soon. It seems that the minimal patch that doesn't have this
problem doesn't require AC_LANG_PROGRAM([], []) but I can add it if
you wish.

Best regards,

-- 
Dmitry
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to