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 D13CAA052E; Mon, 9 Mar 2020 19:57:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8BA741C011; Mon, 9 Mar 2020 19:57:52 +0100 (CET) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 010A51BFF6 for ; Mon, 9 Mar 2020 19:57:50 +0100 (CET) Received: by mail-pl1-f196.google.com with SMTP id g12so4371328plo.3 for ; Mon, 09 Mar 2020 11:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JghenwO6lVErjoqhldUury90ZZl1t3rLzA+OSGn8PCQ=; b=Jzd/xScmDIwSsr8927iaZ3L8GK+eWHpfMFImsqNMMWcirXwjqHz79LiX1GNlo4VI04 0ZZLSNDBQVRyF2F+wwRaJ8nBJvQk0BlWCH42FUXGWqc8WGOwzTfRGPV8zSSA+bQITfEs fkZUz4e/M6f1IQ/Gt29kdZfl+4VBrs7B/eCO7H17U5W9wvRa6Gjg1O3fSvQndpGwy6RP YEBEpph0Iur16a5g7NVO6caEmUbpmyaIEL4q5AEFPtxm0yp7H7AUNGL7A0kves1AGNlQ /v0hggwlhe2Pgeoiq3FIJglncIdQ4MgiqN9COVJOi+C4CddF3m7mgk42pDS5C/wGfBBg ZUYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JghenwO6lVErjoqhldUury90ZZl1t3rLzA+OSGn8PCQ=; b=qnhpjUlizZfP2LZbuFUaWDorYr6xqsPTqcoCFAgT+NwdK2dehZxodHp0bEcIVSeMu5 FTHUM51xCUaNWl8tCWtoN4vv6CD+J91MFiVwihgVkAWq0ztzzyjKuA74X7gjSUBJl0Xz FaYeUfQ00dSyoz68pne3Tg89fQp7YyXSC5Oo3OMtylnFRV+CriBBQxxtl/Jer9VWySN/ 2DxwqEiOFrbmb3S3r9Hxb7O5AdLZ91eBuI+sBGWg36qWApbEuJYJJ3BPmVSx02idJRcq Jfj8h8erj3K76n1HgiULpe84tby+rwJDNBNrIEpZbWmqF23Iz7ZzTeNioNFfLVAwb0IG PZxg== X-Gm-Message-State: ANhLgQ1gKRQj2sp055GVbSReoZStAVNHR7zgmlMtSIfwePK1mY0YMiNF H9fxtwN94U0aLU9oZbvBc/jRJQ== X-Google-Smtp-Source: ADFU+vsUZZ0exwR2fQLrMVoDpoJVRamDiundNVabqajbqIfaA2HBoQdrkN8oE2n7pf0ZiCV0vIo55w== X-Received: by 2002:a17:902:aa98:: with SMTP id d24mr17364725plr.106.1583780269879; Mon, 09 Mar 2020 11:57:49 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id e2sm11546155pgv.81.2020.03.09.11.57.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 11:57:49 -0700 (PDT) Date: Mon, 9 Mar 2020 11:57:41 -0700 From: Stephen Hemminger To: "Medvedkin, Vladimir" Cc: Andrzej Ostruszka , dev@dpdk.org, Bruce Richardson Message-ID: <20200309115741.786e91ed@hermes.lan> In-Reply-To: <9567b22d-96d2-edea-a3f4-42f7a83d8fb3@intel.com> References: <20200303125345.26317-1-aostruszka@marvell.com> <2d22e4b0-6b3c-08c0-e687-b7b420c53150@intel.com> <20200309085236.4938969b@hermes.lan> <9567b22d-96d2-edea-a3f4-42f7a83d8fb3@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Mon, 9 Mar 2020 18:02:21 +0000 "Medvedkin, Vladimir" wrote: > 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 *). > Something else is going on. There are lots of places in code where something like this is done (without warning). extern int strcmp(const char *, const char *); int foo(char *arg) { return strcmp(arg, "foo") == 0; }