On 1/25/26 9:37 PM, Dmitry Mityugov wrote:
> Parameter ldpfec isn't used in function mplsLdpFecEncodingLength(), and
> this may trigger a compiler warning. To reproduce this warning, please
> run
> 
> ./configure --enable-Werror CFLAGS="-Wunused-parameter" && make
> 
> The problem was originally discovered with CLANG 21.1.6 and later
> reproduced with GCC 15.2.1. It's probably possible to reproduce it with
> older versions of the compilers as well.

I'm pretty sure you can reproduce this with very old versions as well.

It's a known thing that slfow library doesn't compile with the 
-Wunused-parameter.
It's not our library it's imported from the original InMon's sFlow Agent 
library.
So, we're not making changes to it normally, unless it's something critical.

In fact, -Wunused-parameter is enabled by default for OVS in configure.ac, but 
the
sflow library is explicitly exempt from this flag for the reason that it doesn't
compile with it.  See the usage of HAVE_WNO_UNUSED_PARAMETER in lib/automake.mk.

So, you should just not force the flag via CFLAGS.  It is already used for the
build in all other parts of OVS.

Best regards, Ilya Maximets.

> 
> Signed-off-by: Dmitry Mityugov <[email protected]>
> ---
> Fixed a "line to long" message from the robot in this version of the
> patch, using clang-format.
> 
>  lib/sflow_receiver.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/sflow_receiver.c b/lib/sflow_receiver.c
> index 3c5aec897..f5e6dbab5 100644
> --- a/lib/sflow_receiver.c
> +++ b/lib/sflow_receiver.c
> @@ -387,7 +387,8 @@ inline static void putMplsLdpFec(SFLReceiver *receiver, 
> SFLExtended_mpls_LDP_FEC
>      putNet32(receiver, ldpfec->mplsFecAddrPrefixLength);
>  }
>  
> -inline static u_int32_t mplsLdpFecEncodingLength(SFLExtended_mpls_LDP_FEC 
> *ldpfec) {
> +inline static u_int32_t
> +mplsLdpFecEncodingLength(SFLExtended_mpls_LDP_FEC *ldpfec OVS_UNUSED) {
>      return 4;
>  }
>  

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

Reply via email to