Array impl_set_masked_funcs is defined in lib/odp-execute-avx512.c
without static modifier but isn't used outside of this module. Recent
versions of GCC can be instructed to deliver warnings for such cases,
with -Wmissing-variable-declarations compiler option enabled. The
problem in question can be reproduced with

./configure --enable-Werror CFLAGS="-Wmissing-variable-declarations" && make

To fix the problem, the array should be defined as static. I believe
this problem can be reproduced only on 64-bit x86 machines, not on
ARM/RISC-V.
---
 lib/odp-execute-avx512.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/odp-execute-avx512.c b/lib/odp-execute-avx512.c
index 13afe0c79..55af58737 100644
--- a/lib/odp-execute-avx512.c
+++ b/lib/odp-execute-avx512.c
@@ -108,7 +108,7 @@ BUILD_ASSERT_DECL(offsetof(struct ovs_key_ipv6,
ipv6_tclass) +
                   offsetof(struct ovs_key_ipv6, ipv6_hlimit));

 /* Array of callback functions, one for each masked operation. */
-odp_execute_action_cb impl_set_masked_funcs[__OVS_KEY_ATTR_MAX];
+static odp_execute_action_cb impl_set_masked_funcs[__OVS_KEY_ATTR_MAX];

 static inline void ALWAYS_INLINE
 avx512_dp_packet_resize_l2(struct dp_packet *b, int resize_by_bytes)
-- 
2.52.0
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to