From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 04/12] eal: allow empty compile time flags Date: Thu, 09 Jul 2015 02:46:17 +0200 Message-ID: <8813269.8bcvtOYP9E@xps13> References: <1436172698-21749-1-git-send-email-zlu@ezchip.com> <1436172698-21749-5-git-send-email-zlu@ezchip.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Zhigang Lu Return-path: Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id B5C075A3E for ; Thu, 9 Jul 2015 02:47:23 +0200 (CEST) Received: by wgjx7 with SMTP id x7so209538756wgj.2 for ; Wed, 08 Jul 2015 17:47:23 -0700 (PDT) In-Reply-To: <1436172698-21749-5-git-send-email-zlu@ezchip.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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++) {