[dpdk-dev] [PATCH v3 04/12] eal: allow empty compile time flags

Thomas Monjalon thomas.monjalon at 6wind.com
Thu Jul 9 02:46:17 CEST 2015


2015-07-06 16:51, Zhigang Lu:
> The rte_cpu_check_supported() code breaks with a "comparison is always
> false due to limited range of data type" when the compile_time_flags[]
> array is empty.  Assigning the array dimension to a local variable
> apparently solves this.

How is it related to the title "allow empty compile time flags"?

> -	unsigned i;
> +	unsigned count = RTE_DIM(compile_time_flags), i;
>  	int ret;

Please define a "const unsigned count =" here to improve readability.

> -	for (i = 0; i < sizeof(compile_time_flags)/sizeof(compile_time_flags[0]); i++) {
> +	for (i = 0; i < count; i++) {





More information about the dev mailing list