DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] kvargs: make pointers in string arrays const
Date: Fri, 13 Jan 2017 18:44:45 +0100	[thread overview]
Message-ID: <20170113184445.7d719306@platinum> (raw)
In-Reply-To: <1484237907-30717-1-git-send-email-bruce.richardson@intel.com>

On Thu, 12 Jan 2017 16:18:27 +0000, Bruce Richardson
<bruce.richardson@intel.com> wrote:
> Change the parameters of functions from const char *valid[] to
> const char * const valid[]. This additional const is needed to
> allow us to fix some checkpatch warnings, as well as being good
> programming practice.
> 
> For the checkpatch warnings, if we have a set of command line
> args that we want to check defined as:
> 	static const char *args[] = { "arg1", "arg2", NULL };
> 	kvlist = rte_kvargs_parse(params, args);
> 
> checkpatch will complain:
> 	WARNING:STATIC_CONST_CHAR_ARRAY: static const char *
> 	array should probably be static const char * const
> 
> Adding the additional const to the definition of the args
> will then trigger a compiler error in the absense of this
> change to the kvargs library, as we lose the const in the
> call to kvargs_parse.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Acked-by: Olivier Matz <olivier.matz@6wind.com>

  reply	other threads:[~2017-01-13 17:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12 16:18 Bruce Richardson
2017-01-13 17:44 ` Olivier Matz [this message]
2017-01-13 18:29   ` 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=20170113184445.7d719306@platinum \
    --to=olivier.matz@6wind.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /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).