[dpdk-dev] [PATCH v2] examples/exception_path: fix shift operation in lcore setup

Yuanhan Liu yuanhan.liu at linux.intel.com
Sun Sep 11 14:38:14 CEST 2016


On Tue, Aug 09, 2016 at 02:37:15PM +0200, Daniel Mrzyglod wrote:
> The operaton may have an undefined behavior or yield to an unexpected result.
> A bit shift operation has a shift amount which is too large or has a negative value.
> 
> As was mentioned in mailing list core list was limited to 64 so i changed bitmask
> to core array
> 
> Coverity issue: 30688
> Fixes: ea977ff1cb0b ("examples/exception_path: fix shift operation in lcore setup")
> 
> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod at intel.com>
> ---
...

> +		if ((end == &tmp_char))
> +			return -1;

Hi,

FYI, my testrobot caught some errors when this patch is applied.
(BTW, gcc builds fine)

        --yliu

---
x86_64-native-linuxapp-clang
============================
/root/dpdk/examples/exception_path/main.c:410:12: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
                if ((end == &tmp_char))
                     ~~~~^~~~~~~~~~~~
/root/dpdk/examples/exception_path/main.c:410:12: note: remove extraneous parentheses around the comparison to silence this warning
                if ((end == &tmp_char))
                    ~    ^           ~
/root/dpdk/examples/exception_path/main.c:410:12: note: use '=' to turn this equality comparison into an assignment
                if ((end == &tmp_char))
                         ^~
                         =
1 error generated.
make[1]: *** [main.o] Error 1
make: *** [all] Error 2
error: build examples/exception_path failed
error: build failed


More information about the dev mailing list