From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 85132A052E; Mon, 9 Mar 2020 19:02:27 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E955D1C01B; Mon, 9 Mar 2020 19:02:26 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 2AEEA2BE6 for ; Mon, 9 Mar 2020 19:02:24 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Mar 2020 11:02:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,518,1574150400"; d="scan'208";a="321507974" Received: from vmedvedk-mobl.ger.corp.intel.com (HELO [10.237.220.123]) ([10.237.220.123]) by orsmga001.jf.intel.com with ESMTP; 09 Mar 2020 11:02:22 -0700 To: Stephen Hemminger Cc: Andrzej Ostruszka , dev@dpdk.org, Bruce Richardson References: <20200303125345.26317-1-aostruszka@marvell.com> <2d22e4b0-6b3c-08c0-e687-b7b420c53150@intel.com> <20200309085236.4938969b@hermes.lan> From: "Medvedkin, Vladimir" Message-ID: <9567b22d-96d2-edea-a3f4-42f7a83d8fb3@intel.com> Date: Mon, 9 Mar 2020 18:02:21 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200309085236.4938969b@hermes.lan> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH] lpm6: make IPv6 addresses immutable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 09/03/2020 15:52, Stephen Hemminger wrote: > On Mon, 9 Mar 2020 13:38:53 +0000 > "Medvedkin, Vladimir" wrote: > >> Hi Andrze, >> >> Adding const qualifier for bulk lookup leads to compilation problems >> (see http://c-faq.com/ansi/constmismatch.html) >> Also I don't think it would be good for usability to make users >> explicitly cast to (const uint8_t **) when passing 'ips' argument. I'd >> suggest leaving lookup_bulk as is. > > Please give a more concrete example. There is no need for explicit cast > in current C. Hi Stephen, In theory, i agree - all modern versions of GCC don't give warnings for this code. The problem is, we don't only support modern versions of GCC. For a "more concrete example", see the following error in gcc-4.8 on CentOS 7: http://mails.dpdk.org/archives/test-report/2020-March/119455.html I have reproduced this on my non-CentOS machine with gcc4.8, so it appears to be gcc4.8 specific rather than CentOS-specific. That said, the same email contains a compile check from RHEL7 with the same compiler version, and it didn't trigger the warning, and also it seems to be that only meson build has triggered the warning (while i have reproduced it with make on my machine). So, i think it is best to leave lookup_bulk as is, and add const qualifiers in other places (for const uint8_t *). -- Regards, Vladimir