On Wed, Jul 23, 2025 at 03:31:52PM +0200, David Marchand wrote:
> Without an explicit type, ip_xor gets promoted to a int.
>
> ../lib/rib/rte_rib6.c:348:26: runtime error:
> left shift of 130 by 24 places cannot be represented in type 'int'
>
> Signed-off-by: David Marchand <[email protected]>
> ---
Acked-by: Bruce Richardson <[email protected]>
> lib/rib/rte_rib6.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c
> index ded5fd044f..ec8ff68e87 100644
> --- a/lib/rib/rte_rib6.c
> +++ b/lib/rib/rte_rib6.c
> @@ -352,7 +352,7 @@ rte_rib6_insert(struct rte_rib6 *rib,
> if (ip_xor == 0)
> d += 8;
> else {
> - d += rte_clz32(ip_xor << 24);
> + d += rte_clz32((uint32_t)ip_xor << 24);
> break;
> }
> }
> --
> 2.50.0
>