From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=lb1VpFJtxTL1vYCpsl+tdbmISGYDlQauGmjzmrzEp7w=; b=cC702AQduIPwT13pmXyTLT4om9bspIu78sXuYoQQuudDSF8Det+VH+QyYIb0u2Bhyx HT6dja5gKZMJF7tv+u9YKqwgmeQsjyYQBllI/8MhUTSqDj8I1Bc9Vwe5aOre/maSWfH8 9kOTjg6hSAUlcUdZnhue7ER1Fa8uYAeLW3tRel3HmIPG5sPB9iTf6SZOZ1HgwSYGzmlA SmBfiaamMavejMmTh9TkHVWjLdHnJ3ZL061DNd2FP9sK25sywRCXgdITX6Eykve2XP2P 70Jmhz403jhxAnHDWUvsbxzv4lNkhuaKTKHdv2gkqA+uPyzHQKbFztwuDz0FXihE65Jj QT5w== X-Gm-Message-State: ALoCoQnajy/BHFRcIMS6nkKlFKRyLHfrfILwBiuIhMuhIS3L2TcC2ZIbYbIQp75hIAGH+B0XTUA1 X-Received: by 10.180.77.233 with SMTP id v9mr79437514wiw.87.1436402843554; Wed, 08 Jul 2015 17:47:23 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id ee1sm5451657wic.8.2015.07.08.17.47.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jul 2015 17:47:22 -0700 (PDT) From: Thomas Monjalon To: Zhigang Lu Date: Thu, 09 Jul 2015 02:46:17 +0200 Message-ID: <8813269.8bcvtOYP9E@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <1436172698-21749-5-git-send-email-zlu@ezchip.com> References: <1436172698-21749-1-git-send-email-zlu@ezchip.com> <1436172698-21749-5-git-send-email-zlu@ezchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v3 04/12] eal: allow empty compile time flags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2015 00:47:24 -0000 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++) {