[dpdk-dev] [PATCH v3 03/24] rte_common.h: cast gcc builtin result to avoid complaints

Thomas Monjalon thomas at monjalon.net
Sun May 13 22:40:00 CEST 2018


12/05/2018 03:58, Andy Green:
> /projects/lagopus/src/dpdk/build/include/rte_common.h:416:9:
> warning: conversion to 'uint32_t' {aka 'unsigned int'} from
> 'int' may change the sign of the result [-Wsign-conversion]
>   return __builtin_ctz(v);
>          ^~~~~~~~~~~~~~~~
> 
> The builtin is defined to return int, but we want to
> return it as uint32_t.  Its only defined valid return
> values are positive integers or zero, which is OK for
> uint32_t.  So just add an explicit cast.

    Fixes: 03f6bced5bba ("eal: use intrinsic function")
    Cc: stable at dpdk.org

> Signed-off-by: Andy Green <andy at warmcat.com>

Applied, thanks




More information about the dev mailing list