DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Medvedkin, Vladimir" <vladimir.medvedkin@intel.com>
Cc: Andrzej Ostruszka <aostruszka@marvell.com>,
	dev@dpdk.org, Bruce Richardson <bruce.richardson@intel.com>
Subject: Re: [dpdk-dev] [PATCH] lpm6: make IPv6 addresses immutable
Date: Mon, 9 Mar 2020 11:57:41 -0700	[thread overview]
Message-ID: <20200309115741.786e91ed@hermes.lan> (raw)
In-Reply-To: <9567b22d-96d2-edea-a3f4-42f7a83d8fb3@intel.com>

On Mon, 9 Mar 2020 18:02:21 +0000
"Medvedkin, Vladimir" <vladimir.medvedkin@intel.com> wrote:

> On 09/03/2020 15:52, Stephen Hemminger wrote:
> > On Mon, 9 Mar 2020 13:38:53 +0000
> > "Medvedkin, Vladimir" <vladimir.medvedkin@intel.com> 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;
}



  reply	other threads:[~2020-03-09 18:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03 12:53 Andrzej Ostruszka
2020-03-09 13:38 ` Medvedkin, Vladimir
2020-03-09 15:52   ` Stephen Hemminger
2020-03-09 18:02     ` Medvedkin, Vladimir
2020-03-09 18:57       ` Stephen Hemminger [this message]
2020-03-09 19:13       ` Stephen Hemminger
2020-03-10  7:49         ` Andrzej Ostruszka
2020-03-10  9:13 ` [dpdk-dev] [PATCH v2] " Andrzej Ostruszka
2020-03-10 14:47   ` Medvedkin, Vladimir
2020-03-31 19:46     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200309115741.786e91ed@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=aostruszka@marvell.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=vladimir.medvedkin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).